Merge tag 'sporttracksduration' into develop
hotfix sporttracks sync workout duration
This commit is contained in:
@@ -191,6 +191,10 @@ def createsporttracksworkoutdata(w):
|
||||
|
||||
averagehr = int(row.df[' HRCur (bpm)'].mean())
|
||||
maxhr = int(row.df[' HRCur (bpm)'].max())
|
||||
duration = w.duration.hour*3600
|
||||
duration += w.duration.minute*60
|
||||
duration += w.duration.second
|
||||
duration += +1.0e-6*w.duration.microsecond
|
||||
|
||||
# adding diff, trying to see if this is valid
|
||||
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
|
||||
@@ -204,7 +208,7 @@ def createsporttracksworkoutdata(w):
|
||||
spm = row.df[' Cadence (stokes/min)'].astype(int)
|
||||
spm[0] = spm[1]
|
||||
hr = row.df[' HRCur (bpm)'].astype(int)
|
||||
|
||||
|
||||
haslatlon=1
|
||||
|
||||
try:
|
||||
@@ -250,7 +254,7 @@ def createsporttracksworkoutdata(w):
|
||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||
"start_time": w.startdatetime.isoformat(),
|
||||
"total_distance": int(w.distance),
|
||||
"duration": int(max(t)),
|
||||
"duration": duration,
|
||||
"notes": w.notes,
|
||||
"avg_heartrate": averagehr,
|
||||
"max_heartrate": maxhr,
|
||||
@@ -266,7 +270,7 @@ def createsporttracksworkoutdata(w):
|
||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||
"start_time": w.startdatetime.isoformat(),
|
||||
"total_distance": int(w.distance),
|
||||
"duration": int(max(t)),
|
||||
"duration": duration,
|
||||
"notes": w.notes,
|
||||
"avg_heartrate": averagehr,
|
||||
"max_heartrate": maxhr,
|
||||
|
||||
Reference in New Issue
Block a user