warmingup/cd
This commit is contained in:
@@ -203,20 +203,32 @@ class IntervalsIntegration(SyncIntegration):
|
||||
return 0
|
||||
|
||||
id = response.json()['id']
|
||||
workout.uploadedtointervals = id
|
||||
workout.save()
|
||||
|
||||
os.remove(filename)
|
||||
|
||||
# set workout type to workouttype
|
||||
url = "https://intervals.icu/api/v1/activity/{activityid}".format(activityid=id)
|
||||
|
||||
|
||||
thetype = mytypes.intervalsmapping[workout.workouttype]
|
||||
response = requests.put(url, headers=headers, json={'type': thetype})
|
||||
jsondict = {'type': thetype}
|
||||
subtype = w.sub_type
|
||||
if subtype:
|
||||
jsondict['sub_type'] = subtype
|
||||
|
||||
jsondict['icu_rpe'] = workout.rpe
|
||||
jsondict['commute'] = workout.is_commute
|
||||
if workout.plannedsession:
|
||||
jsondict['paired_event_id'] = workout.plannedsession.intervals_icu_id
|
||||
|
||||
|
||||
response = requests.put(url, headers=headers, json=jsondict)
|
||||
|
||||
if response.status_code not in [200, 201]:
|
||||
return 0
|
||||
|
||||
workout.uploadedtointervals = id
|
||||
workout.save()
|
||||
|
||||
os.remove(filename)
|
||||
|
||||
dologging('intervals.icu.log', "Exported workout {id}".format(id=workout.id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user