fixed
This commit is contained in:
@@ -582,12 +582,26 @@ def strokedata_fit(request):
|
||||
row = FP(fit_filename)
|
||||
|
||||
rowdata = rowingdata(df=row.df)
|
||||
duration = totaltime_sec_to_string(rowdata.duration)
|
||||
title = "ActiveSpeed water"
|
||||
|
||||
duration = totaltime_sec_to_string(rowdata.duration)
|
||||
distance = rowdata.df[" Horizontal (meters)"].iloc[-1]
|
||||
title = ""
|
||||
try:
|
||||
startdatetime = rowdata.rowdatetime
|
||||
startdate = startdatetime.date()
|
||||
partofday = part_of_day(startdatetime.hour)
|
||||
title = '{partofday} water'.format(partofday=partofday)
|
||||
except Exception as e:
|
||||
dologging('apilog.log','FIT error to get time')
|
||||
dologging('apilog.log',e)
|
||||
_ = myqueue(queuehigh, handle_sendemail_unrecognized, fit_filename, "fit parser")
|
||||
|
||||
w = Workout.objects.create(user=request.user.rower,
|
||||
duration=duration,
|
||||
name=title,)
|
||||
distance=distance,
|
||||
name=title,
|
||||
date=startdate,
|
||||
workouttype='water',)
|
||||
|
||||
uploadoptions = {
|
||||
'secret': UPLOAD_SERVICE_SECRET,
|
||||
@@ -598,7 +612,7 @@ def strokedata_fit(request):
|
||||
'title': title,
|
||||
'rpe': 0,
|
||||
'notes': '',
|
||||
'workoutid': w.id,
|
||||
'id': w.id,
|
||||
'offline': False,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user