Private
Public Access
1
0

temp logging

This commit is contained in:
2024-12-11 19:23:44 +01:00
parent bbb85d7799
commit 3e9c23b03f
4 changed files with 38 additions and 2 deletions

View File

@@ -128,7 +128,7 @@ class IntervalsIntegration(SyncIntegration):
except TypeError:
newnotes = 'from'+w.workoutsource+' via rowsandall.com'
row.exporttotcx(tcxfilename, notes=newnotes)
row.exporttotcx(tcxfilename, notes=newnotes, sport=mytypes.intervalsmapping[w.workouttype])
if dozip:
gzfilename = tcxfilename + '.gz'
try:
@@ -181,6 +181,7 @@ class IntervalsIntegration(SyncIntegration):
# 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})

View File

@@ -66,7 +66,7 @@ class TPIntegration(SyncIntegration):
except TypeError:
newnotes = 'from '+w.workoutsource+' via rowsandall.com'
row.exporttotcx(tcxfilename, notes=newnotes)
row.exporttotcx(tcxfilename, notes=newnotes, sport=tpmapping(w.workouttype))
return tcxfilename

View File

@@ -181,7 +181,40 @@ fitcollection = (
fitmapping = {key: value for key, value in Reverse(fitcollection)}
tcxcollection = (
('water', 'Rowing'),
('rower', 'Rowing'),
('skierg', 'CrossCountrySkiing'),
('bike', 'Biking'),
('bikeerg', 'Biking'),
('dynamic', 'Rowing'),
('slides', 'Rowing'),
('paddle', 'Other'),
('snow', 'CrossCountrySkiing'),
('coastal', 'Rowing'),
('c-boat', 'Rowing'),
('churchboat', 'Rowing'),
('Ride', 'Biking'),
('Run', 'Running'),
('NordicSki', 'CrossCountrySkiing'),
('Swim', 'Swimming'),
('Hike', 'Hiking'),
('Walk', 'Walking'),
('Canoeing', 'Other'),
('Crossfit', 'Other'),
('StandUpPaddling', 'Other'),
('IceSkate', 'Other'),
('WeightTraining', 'Other'),
('InlineSkate', 'Other'),
('Kayaking', 'Other'),
('Workout', 'Other'),
('Yoga', 'Other'),
('other', 'Other'),
)
tcxmapping = {key: value for key, value in Reverse(tcxcollection)}
tcxmappinginv = {value: key for key, value in Reverse(tcxcollection) if value is not None}
intervalscollection = (
('water', 'Rowing'),

View File

@@ -4971,6 +4971,8 @@ def workout_upload_api(request):
message = {'status': 'false', 'message': 'could not find file'}
return JSONResponse(status=400, data=message)
dologging('own_api.log','-temp-')
dologging('own_api.log',post_data)
# sync related IDs
sporttracksid = post_data.get('sporttracksid','')