Private
Public Access
1
0

through email now

This commit is contained in:
Sander Roosendaal
2018-06-28 14:26:08 +02:00
parent f3edead9b9
commit 6acb5d9f49
6 changed files with 62 additions and 37 deletions

View File

@@ -165,7 +165,7 @@ def get_strava_workouts(rower):
newids = [stravaid for stravaid in stravaids if not stravaid in knownstravaids]
for stravaid in newids:
workoutid = create_async_workout(alldata,rower.user,stravaid)
result = create_async_workout(alldata,rower.user,stravaid)
return 1
@@ -234,29 +234,38 @@ def create_async_workout(alldata,user,stravaid,debug=False):
code = uuid4().hex[:16]
)
w = Workout(
user=r,
workouttype = workouttype,
name = title,
date = workoutdate,
starttime = starttime,
startdatetime = rowdatetime,
timezone = thetimezone,
duration = duration,
distance=distance,
weightcategory = weightcategory,
uploadedtostrava = stravaid,
csvfilename = csvfilename,
notes = ''
)
# w = Workout(
# user=r,
# workouttype = workouttype,
# name = title,
# date = workoutdate,
# starttime = starttime,
# startdatetime = rowdatetime,
# timezone = thetimezone,
# duration = duration,
# distance=distance,
# weightcategory = weightcategory,
# uploadedtostrava = stravaid,
# csvfilename = csvfilename,
# notes = ''
# )
w.save()
# Check if workout has stroke data, and get the stroke data
result = add_stroke_data(user,stravaid,w.id,rowdatetime,csvfilename,debug=debug)
starttimeunix = arrow.get(rowdatetime).timestamp
return w.id
job = myqueue(queue,
handle_strava_import_stroke_data,
title,
user.email,
r.stravatoken,
stravaid,
starttimeunix,
csvfilename,
)
return 1
from utils import get_strava_stream