Private
Public Access
1
0

adding check for garmin on icu import

This commit is contained in:
2025-10-24 15:47:30 +02:00
parent fa2944a7a5
commit 9be6c991fb
4 changed files with 93 additions and 4 deletions

View File

@@ -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,