fixing strava import failure
This commit is contained in:
@@ -150,7 +150,12 @@ def get_strava_workouts(rower):
|
||||
start_date = item['start_date']
|
||||
stravaid = item['id']
|
||||
if arrow.get(start_date) == arrow.get(w.startdatetime):
|
||||
if datetime.time(seconds=int(elapsed_time)) == w.duration:
|
||||
dd = datetime.min + timedelta(
|
||||
seconds=int(elapsed_time)
|
||||
)
|
||||
|
||||
|
||||
if datetime.time(dd) == w.duration:
|
||||
w.uploadedtostrava = int(stravaid)
|
||||
w.save()
|
||||
|
||||
|
||||
@@ -377,7 +377,12 @@ def totaltime_sec_to_string(totaltime):
|
||||
if not message:
|
||||
message = 'Warning: there is something wrong with the workout duration'
|
||||
|
||||
duration = "%s:%s:%s.%s" % (hours, minutes, seconds, tenths)
|
||||
duration = "{hours:02d}:{minutes:02d}:{seconds:02d}.{tenths}".format(
|
||||
hours=hours,
|
||||
minutes=minutes,
|
||||
seconds=seconds,
|
||||
tenths=tenths
|
||||
)
|
||||
|
||||
return duration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user