fixed
This commit is contained in:
@@ -1289,10 +1289,10 @@ def parsenonpainsled(fileformat, f2, summary, startdatetime='', empowerfirmware=
|
|||||||
# handle FIT
|
# handle FIT
|
||||||
if (fileformat == 'fit'): # pragma: no cover
|
if (fileformat == 'fit'): # pragma: no cover
|
||||||
try:
|
try:
|
||||||
s = fitsummarydata(f2)
|
s = FitSummaryData(f2)
|
||||||
s.setsummary()
|
s.setsummary()
|
||||||
summary = s.summarytext
|
summary = s.summarytext
|
||||||
except:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
hasrecognized = True
|
hasrecognized = True
|
||||||
|
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -582,12 +582,26 @@ def strokedata_fit(request):
|
|||||||
row = FP(fit_filename)
|
row = FP(fit_filename)
|
||||||
|
|
||||||
rowdata = rowingdata(df=row.df)
|
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,
|
w = Workout.objects.create(user=request.user.rower,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
name=title,)
|
distance=distance,
|
||||||
|
name=title,
|
||||||
|
date=startdate,
|
||||||
|
workouttype='water',)
|
||||||
|
|
||||||
uploadoptions = {
|
uploadoptions = {
|
||||||
'secret': UPLOAD_SERVICE_SECRET,
|
'secret': UPLOAD_SERVICE_SECRET,
|
||||||
@@ -598,7 +612,7 @@ def strokedata_fit(request):
|
|||||||
'title': title,
|
'title': title,
|
||||||
'rpe': 0,
|
'rpe': 0,
|
||||||
'notes': '',
|
'notes': '',
|
||||||
'workoutid': w.id,
|
'id': w.id,
|
||||||
'offline': False,
|
'offline': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user