diff --git a/run_page/codoon_sync.py b/run_page/codoon_sync.py index c91a69e6169..3ba9ed05bcb 100755 --- a/run_page/codoon_sync.py +++ b/run_page/codoon_sync.py @@ -555,6 +555,7 @@ def parse_raw_data_to_namedtuple( "id": log_id, "name": str(cast_type) + " from codoon", "type": cast_type, + "subtype": cast_type, "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end_date, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), diff --git a/run_page/endomondo_sync.py b/run_page/endomondo_sync.py index bdecf438d68..2a6ebf61929 100644 --- a/run_page/endomondo_sync.py +++ b/run_page/endomondo_sync.py @@ -54,6 +54,7 @@ def parse_run_endomondo_to_nametuple(en_dict): "id": en_dict.get("id"), "name": "run from endomondo", "type": "Run", # TODO others + "subtype": "Run", # TODO others "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end_date, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime(start_date_local, "%Y-%m-%d %H:%M:%S"), diff --git a/run_page/joyrun_sync.py b/run_page/joyrun_sync.py index e562c0ebd50..d070210185b 100755 --- a/run_page/joyrun_sync.py +++ b/run_page/joyrun_sync.py @@ -303,6 +303,7 @@ def parse_raw_data_to_nametuple(self, run_data, old_gpx_ids, with_gpx=False): "name": "run from joyrun", # future to support others workout now only for run "type": "Run", + "subtype": "Run", "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime( diff --git a/run_page/keep_sync.py b/run_page/keep_sync.py index d49a8341981..eb3cebe0023 100755 --- a/run_page/keep_sync.py +++ b/run_page/keep_sync.py @@ -159,6 +159,7 @@ def parse_raw_data_to_nametuple( "name": f"{KEEP2STRAVA[run_data['dataType']]} from keep", # future to support others workout now only for run "type": f"{KEEP2STRAVA[(run_data['dataType'])]}", + "subtype": f"{KEEP2STRAVA[(run_data['dataType'])]}", "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime(start_date_local, "%Y-%m-%d %H:%M:%S"), diff --git a/run_page/nike_sync.py b/run_page/nike_sync.py index 79fd9504334..7adc0c12cb7 100644 --- a/run_page/nike_sync.py +++ b/run_page/nike_sync.py @@ -39,22 +39,6 @@ class Nike: def __init__(self, access_token): self.client = httpx.Client() - # HINT: if you have old nrc refresh_token un comments this lines it still works - - # response = self.client.post( - # TOKEN_REFRESH_URL, - # headers=NIKE_HEADERS, - # json={ - # "refresh_token": access_token, # its refresh_token for tesy here - # "client_id": b64decode(NIKE_CLIENT_ID).decode(), - # "grant_type": "refresh_token", - # "ux_id": b64decode(NIKE_UX_ID).decode(), - # }, - # timeout=60, - # ) - # response.raise_for_status() - # access_token = response.json()["access_token"] - self.client.headers.update({"Authorization": f"Bearer {access_token}"}) def get_activities_since_timestamp(self, timestamp): @@ -361,6 +345,7 @@ def parse_no_gpx_data(activity): "id": int(nike_id), "name": "run from nike", "type": "Run", + "subtype": "Run", "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end_date, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime(start_date_local, "%Y-%m-%d %H:%M:%S"), diff --git a/run_page/oppo_sync.py b/run_page/oppo_sync.py index e810655ee46..8fab775d540 100644 --- a/run_page/oppo_sync.py +++ b/run_page/oppo_sync.py @@ -233,6 +233,7 @@ def parse_raw_data_to_name_tuple(sport_data, with_gpx, with_tcx): "name": "activity from oppo", # future to support others workout now only for run "type": map_oppo_fit_type_to_strava_activity_type(sport_data["sportMode"]), + "subtype": map_oppo_fit_type_to_strava_activity_type(sport_data["sportMode"]), "start_date": datetime.strftime(start_date, "%Y-%m-%d %H:%M:%S"), "end": datetime.strftime(end, "%Y-%m-%d %H:%M:%S"), "start_date_local": datetime.strftime(start_date_local, "%Y-%m-%d %H:%M:%S"), diff --git a/run_page/tulipsport_sync.py b/run_page/tulipsport_sync.py index a99c12c91ad..f55470272fa 100755 --- a/run_page/tulipsport_sync.py +++ b/run_page/tulipsport_sync.py @@ -65,6 +65,7 @@ def get_all_activity_summaries(session, headers, start_time=None): "moving_time": moving_time, "elapsed_time": moving_time, "type": "Run", + "subtype": "Run", "start_date": start_date, "start_date_local": start_date_local, "end_date": start_date + moving_time,