add match option to stravaexportas
This commit is contained in:
@@ -752,23 +752,36 @@ def workout_strava_upload(user,w, quick=False,asynchron=True):
|
||||
tcxfile, tcxmesg = createstravaworkoutdata(w)
|
||||
if not tcxfile:
|
||||
return "Failed to create workout data",0
|
||||
activity_type = r.stravaexportas
|
||||
if r.stravaexportas == 'match':
|
||||
try:
|
||||
activity_type = mytypes.stravamapping[w.workouttype]
|
||||
except KeyError:
|
||||
activity_type = 'Rowing'
|
||||
job = myqueue(queue,
|
||||
handle_strava_sync,
|
||||
r.stravatoken,
|
||||
w.id,
|
||||
tcxfile,w.name,r.stravaexportas,
|
||||
tcxfile,w.name,activity_type,
|
||||
w.notes
|
||||
)
|
||||
return "Asynchronous sync",-1
|
||||
try:
|
||||
tcxfile,tcxmesg = createstravaworkoutdata(w)
|
||||
if tcxfile:
|
||||
activity_type = r.stravaexportas
|
||||
if r.stravaexportas == 'match':
|
||||
try:
|
||||
activity_type = mytypes.stravamapping[w.workouttype]
|
||||
except KeyError:
|
||||
activity_type = 'Rowing'
|
||||
print(w.workouttype,activity_type)
|
||||
with open(tcxfile,'rb') as f:
|
||||
res,mes = handle_stravaexport(
|
||||
f,w.name,
|
||||
r.stravatoken,
|
||||
description=w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||
activity_type=r.stravaexportas,quick=quick,asynchron=asynchron)
|
||||
activity_type=activity_type,quick=quick,asynchron=asynchron)
|
||||
if res==0:
|
||||
message = mes
|
||||
w.uploadedtostrava = -1
|
||||
|
||||
Reference in New Issue
Block a user