From 25f22a919192fb60e8f674b68b16806ccc023df2 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Thu, 2 Nov 2023 16:33:03 +0000 Subject: [PATCH] Add activity columns: sport_type, trainer --- src/strava_offline/sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/strava_offline/sync.py b/src/strava_offline/sync.py index 8321ed1..26a3e7b 100644 --- a/src/strava_offline/sync.py +++ b/src/strava_offline/sync.py @@ -33,7 +33,9 @@ 'total_elevation_gain': "REAL", 'gear_id': "TEXT", 'type': "TEXT", + 'sport_type': "TEXT", 'commute': "BOOLEAN", + 'trainer': "BOOLEAN", 'has_location_data': "BOOLEAN", }, from_dict=lambda activity: { @@ -47,7 +49,9 @@ 'total_elevation_gain': activity['total_elevation_gain'], 'gear_id': activity['gear_id'], 'type': activity['type'], + 'sport_type': activity.get('sport_type'), 'commute': activity['commute'], + 'trainer': activity['trainer'], 'has_location_data': isinstance(activity['start_latlng'], list) and len(activity['start_latlng']) >= 2, }, ) @@ -55,7 +59,7 @@ schema = sqlite.Schema( # Version of database schema. Bump this whenever the schema changes, # tables will be recreated using the stored json data and the new schema. - version=3, + version=4, tables=[ table_bike,