Private
Public Access
1
0

some more wup and cd stuff

This commit is contained in:
2025-02-18 17:47:56 +01:00
parent 43a2e13e35
commit 9767cc3bd3
3 changed files with 28 additions and 5 deletions

View File

@@ -471,6 +471,20 @@ class IntervalsIntegration(SyncIntegration):
except KeyError:
is_commute = False
try:
is_race = data['race']
if is_race is None:
is_race = False
except KeyError:
is_race = False
try:
subtype = data['sub_type']
if subtype is not None:
subtype = subtype.capitalize()
except KeyError:
subtype = None
try:
workouttype = mytypes.intervalsmappinginv[data['type']]
except KeyError:
@@ -520,9 +534,17 @@ class IntervalsIntegration(SyncIntegration):
pair_id = data['paired_event_id']
pss = PlannedSession.objects.filter(intervals_icu_id=pair_id, rower=r)
ws = Workout.objects.filter(uploadedtointervals=id)
for w in ws:
w.sub_type = subtype
w.save()
if is_commute:
for w in ws:
w.is_commute = True
w.sub_type = "Commute"
w.save()
if is_race:
for w in ws:
w.is_race = True
w.save()
if pss.count() > 0:
for ps in pss:

View File

@@ -3680,17 +3680,18 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
try:
paired_event_id = data['paired_event_id']
ws = Workout.objects.filter(uploadedtointervals=workoutid)
for w in ws:
w.sub_type = subtype
w.save()
if is_commute:
for w in ws:
w.is_commute = True
w.sub_type = "Commute"
w.save()
for w in ws:
w.sub_type = subtype
w.save()
if is_race:
w.is_race = True
w.save()
for w in ws:
w.is_race = True
w.save()
if ws.count() > 0:
pss = PlannedSession.objects.filter(rower=rower,intervals_icu_id=paired_event_id)
if pss.count() > 0:

Binary file not shown.