adding check for garmin on icu import
This commit is contained in:
@@ -3759,11 +3759,19 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
|
||||
data = response.json()
|
||||
|
||||
try:
|
||||
workoutsource = data['device_name']
|
||||
except KeyError:
|
||||
workoutsource = 'intervals.icu'
|
||||
|
||||
try:
|
||||
title = data['name']
|
||||
except KeyError:
|
||||
title = 'Intervals workout'
|
||||
|
||||
if 'garmin' in workoutsource.lower():
|
||||
title = 'Garmin: '+ title
|
||||
|
||||
try:
|
||||
workouttype = intervalsmappinginv[data['type']]
|
||||
except KeyError:
|
||||
@@ -3825,6 +3833,7 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
'user': rower.user.id,
|
||||
'boattype': '1x',
|
||||
'workouttype': workouttype,
|
||||
'workoutsource': workoutsource,
|
||||
'file': fit_filename,
|
||||
'intervalsid': workoutid,
|
||||
'title': title,
|
||||
|
||||
Reference in New Issue
Block a user