Strava import - imported time instead of distance
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -708,7 +708,6 @@ def add_workout_from_stdata(user,importid,data):
|
||||
title = "Imported data"
|
||||
|
||||
|
||||
|
||||
res = splitstdata(data['distance'])
|
||||
|
||||
distance = res[1]
|
||||
|
||||
Reference in New Issue
Block a user