import now behaving
This commit is contained in:
@@ -107,8 +107,20 @@ class IntervalsIntegration(SyncIntegration):
|
||||
|
||||
def get_workout_list(self, *args, **kwargs) -> int:
|
||||
url = self.oauth_data['base_url'] + 'athlete/0/activities?'
|
||||
startdate = timezone.now() - timedelta(days=365)
|
||||
startdate = timezone.now() - timedelta(days=30)
|
||||
enddate = timezone.now() + timedelta(days=1)
|
||||
startdatestring = kwargs.get("startdate","")
|
||||
enddatestring = kwargs.get("enddate","")
|
||||
|
||||
try:
|
||||
startdate = arrow.get(startdatestring).datetime
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
enddate = arrow.get(enddatestring).datetime
|
||||
except:
|
||||
pass
|
||||
|
||||
url += 'oldest=' + startdate.strftime('%Y-%m-%d') + '&newest=' + enddate.strftime('%Y-%m-%d')
|
||||
headers = {
|
||||
'accept': '*/*',
|
||||
@@ -122,7 +134,6 @@ class IntervalsIntegration(SyncIntegration):
|
||||
|
||||
data = response.json()
|
||||
known_interval_ids = get_known_ids(self.rower, 'intervalsid')
|
||||
|
||||
workouts = []
|
||||
|
||||
for item in data:
|
||||
@@ -145,7 +156,7 @@ class IntervalsIntegration(SyncIntegration):
|
||||
|
||||
ress = dict(zip(keys, values))
|
||||
workouts.append(ress)
|
||||
|
||||
|
||||
return workouts
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user