fixing error
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user