Private
Public Access
1
0

Strava import - imported time instead of distance

This commit is contained in:
Sander Roosendaal
2017-04-01 15:49:14 +02:00
parent 9fec0ebd03
commit 3e79336fc8
2 changed files with 1 additions and 4 deletions

View File

@@ -156,7 +156,6 @@ def get_strava_workout(user,stravaid):
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/heartrate?resolution="+fetchresolution+"&series_type="+series_type
hrjson = requests.get(url,headers=headers)
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/time?resolution="+fetchresolution+"&series_type="+series_type
print url
timejson = requests.get(url,headers=headers)
url = "https://www.strava.com/api/v3/activities/"+str(stravaid)+"/streams/velocity_smooth?resolution="+fetchresolution+"&series_type="+series_type
velojson = requests.get(url,headers=headers)
@@ -167,7 +166,7 @@ def get_strava_workout(user,stravaid):
try:
t = np.array(timejson.json()[0]['data'])
d = np.array(distancejson.json()[0]['data'])
d = np.array(distancejson.json()[1]['data'])
nr_rows = len(t)
if nr_rows == 0:
return (0,"Error: Time data had zero length")
@@ -175,7 +174,6 @@ def get_strava_workout(user,stravaid):
return (0,"something went wrong with the Strava import")
try:
print spmjson.json()
spm = np.array(spmjson.json()[1]['data'])
except:
spm = np.zeros(nr_rows)

View File

@@ -708,7 +708,6 @@ def add_workout_from_stdata(user,importid,data):
title = "Imported data"
res = splitstdata(data['distance'])
distance = res[1]