Private
Public Access
1
0

fixing error

This commit is contained in:
2024-12-15 13:27:04 +01:00
parent 4a4de49a18
commit 19d0d54859

View File

@@ -242,25 +242,29 @@ class IntervalsIntegration(SyncIntegration):
workouts = [] workouts = []
for item in data: for item in data:
i = item['id'] try:
r = item['type'] i = item['id']
d = item['distance'] r = item['type']
ttot = seconds_to_duration(item['moving_time']) d = item['distance']
s = item['start_date'] ttot = seconds_to_duration(item['moving_time'])
s2 = '' s = item['start_date']
c = item['name'] s2 = ''
if i in known_interval_ids: c = item['name']
nnn = '' if i in known_interval_ids:
else: nnn = ''
nnn = 'NEW' else:
nnn = 'NEW'
keys = ['id','distance','duration','starttime', keys = ['id','distance','duration','starttime',
'rowtype','source','name','new'] 'rowtype','source','name','new']
values = [i, d, ttot, s, r, s2, c, nnn] values = [i, d, ttot, s, r, s2, c, nnn]
ress = dict(zip(keys, values))
workouts.append(ress)
except KeyError:
dologging('intervals.icu.log', item)
ress = dict(zip(keys, values))
workouts.append(ress)
return workouts return workouts