From f99d979dca7046bbc1573270a7c51ac24d14102f Mon Sep 17 00:00:00 2001 From: Thomas Champagne Date: Sun, 3 Nov 2024 11:39:40 +0100 Subject: [PATCH 1/2] Fix webext broken sync --- .../models/sync/strava-activity.model.ts | 23 ++++--- .../processors/activities-synchronize.ts | 4 +- .../processors/multiple-activity-processor.ts | 8 +-- .../fixtures/sync/rawPage0120161213.json | 60 ++++++------------ .../fixtures/sync/rawPage0220161213.json | 60 ++++++------------ .../fixtures/sync/rawPage0320161213.json | 60 ++++++------------ .../fixtures/sync/rawPage0420161213.json | 60 ++++++------------ .../fixtures/sync/rawPage0520161213.json | 61 ++++++------------- .../fixtures/sync/rawPage0620161213.json | 60 ++++++------------ .../fixtures/sync/rawPage0720161213.json | 60 ++++++------------ .../specs/sync/activities-sync-basics.spec.ts | 12 ++-- .../specs/sync/activities-sync-stubed.spec.ts | 10 +-- webextension/specs/tools/specs-tools.ts | 2 +- 13 files changed, 173 insertions(+), 307 deletions(-) diff --git a/webextension/scripts/models/sync/strava-activity.model.ts b/webextension/scripts/models/sync/strava-activity.model.ts index 0d99761d1..d39d78ee0 100644 --- a/webextension/scripts/models/sync/strava-activity.model.ts +++ b/webextension/scripts/models/sync/strava-activity.model.ts @@ -1,12 +1,12 @@ export class StravaActivityModel { public id: number; public name: string; - public type: string; + public sport_type: string; public display_type: string; public activity_type_display_name: string; public private: boolean; - public bike_id: number; - public athlete_gear_id: number; + public bike_id: number | null; + public athlete_gear_id: number | null; public start_date: string; public start_date_local_raw: number; public start_time: string; @@ -20,21 +20,24 @@ export class StravaActivityModel { public elapsed_time: string; public elapsed_time_raw: number; public trainer: boolean; - public static_map: boolean; - public show_elevation: boolean; + public static_map: string; public has_latlng: boolean; public commute: boolean; public elevation_gain: string; public elevation_unit: string; public elevation_gain_raw: number; - public description: string; + public description: string | null; + public activity_url: string; + public activity_url_for_twitter: string; + public twitter_msg: string; public is_new: boolean; public is_changing_type: boolean; - public suffer_score: number; - public calories: number; - public feed_data: any; - public workout_type: string; + public suffer_score: number | null; + public tags: { [key: string]: boolean }; + public selected_tag_type: string | null; public flagged: boolean; public hide_power: boolean; public hide_heartrate: boolean; + public leaderboard_opt_out: boolean; + public visibility: string; } diff --git a/webextension/scripts/processors/activities-synchronize.ts b/webextension/scripts/processors/activities-synchronize.ts index bc607986c..c5c9f36e4 100644 --- a/webextension/scripts/processors/activities-synchronize.ts +++ b/webextension/scripts/processors/activities-synchronize.ts @@ -123,11 +123,11 @@ export class ActivitiesSynchronize { if (foundActivity) { // Yes => Check for an edit.. - if (foundActivity.name !== rawActivity.name || foundActivity.type !== rawActivity.type) { + if (foundActivity.name !== rawActivity.name || foundActivity.type !== rawActivity.sport_type) { edited.push({ id: foundActivity.id as number, name: rawActivity.name, - type: rawActivity.type as ElevateSport + type: rawActivity.sport_type as ElevateSport }); } } else { diff --git a/webextension/scripts/processors/multiple-activity-processor.ts b/webextension/scripts/processors/multiple-activity-processor.ts index 12acf0eda..54c6f8c00 100644 --- a/webextension/scripts/processors/multiple-activity-processor.ts +++ b/webextension/scripts/processors/multiple-activity-processor.ts @@ -91,7 +91,7 @@ export class MultipleActivityProcessor { const activityComputed: Activity = new Activity(); activityComputed.id = streamActivityModel.id; activityComputed.name = streamActivityModel.name; - activityComputed.type = streamActivityModel.type as ElevateSport; + activityComputed.type = streamActivityModel.sport_type as ElevateSport; activityComputed.startTimestamp = startTimestamp; activityComputed.endTimestamp = endTimestamp; activityComputed.startTime = streamActivityModel.start_time; @@ -107,7 +107,7 @@ export class MultipleActivityProcessor { activityComputed.stats.elapsedTime = streamActivityModel.elapsed_time_raw; activityComputed.stats.distance = streamActivityModel.distance_raw; activityComputed.stats.moveRatio = activityComputed.stats.movingTime / activityComputed.stats.elapsedTime; - activityComputed.stats.calories = streamActivityModel.calories; + // activityComputed.stats.calories = streamActivityModel.calories; activityComputed.stats.caloriesPerHour = activityComputed.stats.calories !== null ? (activityComputed.stats.calories / activityComputed.stats.elapsedTime) * Constant.SEC_HOUR_FACTOR @@ -194,8 +194,8 @@ export class MultipleActivityProcessor { const activityEssentials: ActivityEssentials = this.provideActivityEssentials(activityWithStream); const threadMessage: ComputeActivityThreadMessageModel = { - activityType: activityWithStream.type as ElevateSport, - supportsGap: activityWithStream.type === "Run", + activityType: activityWithStream.sport_type as ElevateSport, + supportsGap: activityWithStream.sport_type === "Run", isTrainer: activityWithStream.trainer, appResources: this.appResources, userSettings: this.userSettings, diff --git a/webextension/specs/fixtures/sync/rawPage0120161213.json b/webextension/specs/fixtures/sync/rawPage0120161213.json index ad129b8ba..3c7d70f78 100644 --- a/webextension/specs/fixtures/sync/rawPage0120161213.json +++ b/webextension/specs/fixtures/sync/rawPage0120161213.json @@ -4,7 +4,7 @@ "id": 799672885, "name": "Running back... Hard !", "emoji_name": "Running back... Hard !", - "type": "Run", + "sport_type": "Run", "display_type": "Course", "activity_type_display_name": "Course \u00e0 pied", "private": true, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 357.37026476759996, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 727632286, "name": "Lunch Ride", "emoji_name": "Lunch Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -83,7 +82,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 536.3377348500001, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 723224273, "name": "Bon rythme ! 33 KPH !!", "emoji_name": "Bon rythme ! 33 KPH !!", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -129,7 +127,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1444.437008, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 722210052, "name": "Fort saint eynard", "emoji_name": "Fort saint eynard", - "type": "Hike", + "sport_type": "Hike", "display_type": "Randonn\u00e9e", "activity_type_display_name": "Randonn\u00e9e", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 554.0288906520001, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 721113868, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -221,7 +217,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 1640.73189945, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 718908064, "name": "P\u00e9dalage avec Madame Jeannie Longo", "emoji_name": "P\u00e9dalage avec Madame Jeannie Longo", - "type": "Ride", + "sport_type": "Ride", "display_type": "Entra\u00eenement", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1527.188968575, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 717815211, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -313,7 +307,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 825.2350710999999, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 716901962, "name": "Evening Run", "emoji_name": "Evening Run", - "type": "Run", + "sport_type": "Run", "display_type": "Course", "activity_type_display_name": "Course \u00e0 pied", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 293.6017113336, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 708752345, "name": "Bastille", "emoji_name": "Bastille", - "type": "Run", + "sport_type": "Run", "display_type": "Entra\u00eenement", "activity_type_display_name": "Course \u00e0 pied", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 737.6812138152002, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 707356065, "name": "Je suis un gros lent !", "emoji_name": "Je suis un gros lent !", - "type": "Run", + "sport_type": "Run", "display_type": "Course", "activity_type_display_name": "Course \u00e0 pied", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 567.5991452064001, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 705118424, "name": "Baladinette", "emoji_name": "Baladinette", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 225.649691575, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 703993615, "name": "Reprise avec Florent et mon poignet en carton", "emoji_name": "Reprise avec Florent et mon poignet en carton", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 868.3757145000001, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 700301520, "name": "Baladinette", "emoji_name": "Baladinette", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -589,7 +577,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 246.58627381200003, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 687620700, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": true, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 956.2066283, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 685081571, "name": "Test Ant+ app Android", "emoji_name": "Test Ant+ app Android", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": true, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 334.191030824, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 684099116, "name": "Balade", "emoji_name": "Balade", - "type": "Hike", + "sport_type": "Hike", "display_type": "Randonn\u00e9e", "activity_type_display_name": "Randonn\u00e9e", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 271.63165968000004, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 675927371, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Entra\u00eenement", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1104.862008565, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 666600070, "name": "Balcons de Belledonne avec Aur\u00e9lie. EZ !", "emoji_name": "Balcons de Belledonne avec Aur\u00e9lie. EZ !", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1433.4474726674998, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 661113141, "name": "Reprise apr\u00e8s vacances", "emoji_name": "Reprise apr\u00e8s vacances", - "type": "Ride", + "sport_type": "Ride", "display_type": "Entra\u00eenement", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 784.5615882, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 657225503, "name": "Hardtail Galibier Downhill", "emoji_name": "Hardtail Galibier Downhill", - "type": "Ride", + "sport_type": "Ride", "display_type": "Sortie \u00e0 v\u00e9lo", "activity_type_display_name": "Sortie \u00e0 v\u00e9lo", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 206.4571485185, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0220161213.json b/webextension/specs/fixtures/sync/rawPage0220161213.json index cbb87a512..02cf6f26a 100644 --- a/webextension/specs/fixtures/sync/rawPage0220161213.json +++ b/webextension/specs/fixtures/sync/rawPage0220161213.json @@ -4,7 +4,7 @@ "id": 656401541, "name": "Easy XC MTB", "emoji_name": "Easy XC MTB", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 525.85479921, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 652212776, "name": "Test Swim", "emoji_name": "Test Swim", - "type": "Swim", + "sport_type": "Swim", "display_type": "Swim", "activity_type_display_name": "Swim", "private": true, @@ -83,7 +82,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 651874303, "name": "Course orientation. Win !!", "emoji_name": "Course orientation. Win !!", - "type": "Walk", + "sport_type": "Walk", "display_type": "Walk", "activity_type_display_name": "Walk", "private": false, @@ -129,7 +127,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 330.49624406399994, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 651564771, "name": "Lunch Walk", "emoji_name": "Lunch Walk", - "type": "Walk", + "sport_type": "Walk", "display_type": "Walk", "activity_type_display_name": "Walk", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 372.1897797120001, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 648202709, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -221,7 +217,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 16.666525386, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 646390253, "name": "Test Trimp/h Connect IQ", "emoji_name": "Test Trimp/h Connect IQ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 779.942949345, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 644365059, "name": "Sortie avec vik", "emoji_name": "Sortie avec vik", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -313,7 +307,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1147.01004663, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 642780978, "name": "Relax", "emoji_name": "Relax", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 648.05741884, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 641842346, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 947.7545135199999, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 639823327, "name": "Running avec Aur\u00e9lie ", "emoji_name": "Running avec Aur\u00e9lie ", - "type": "Run", + "sport_type": "Run", "display_type": "Run", "activity_type_display_name": "Run", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 888.5420582400001, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 636437864, "name": "Castor @ https://www.relive.cc/view/636437864", "emoji_name": "Castor @ https://www.relive.cc/view/636437864", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 3121.9670852, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 635350470, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 880.9498594, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 634869308, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 328.17370853999995, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 633374437, "name": "Perreree avec Aur\u00e9lie ", "emoji_name": "Perreree avec Aur\u00e9lie ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 727.3076847855, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 632205691, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 856.3612951399999, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 628842674, "name": "4 Seigneurs \u0026 Balcons de Belledonne - https://www.relive.cc/view/628842674", "emoji_name": "4 Seigneurs \u0026 Balcons de Belledonne - https://www.relive.cc/view/628842674", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2565.4956504, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 626807611, "name": "Perreree avec Aur\u00e9lie", "emoji_name": "Perreree avec Aur\u00e9lie", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 664.867490664, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 625798007, "name": ".", "emoji_name": ".", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 778.7755075499999, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 624735627, "name": "Fish?!", "emoji_name": "Fish?!", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 661.0300770050001, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 623709272, "name": "Venon par Perreree ", "emoji_name": "Venon par Perreree ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 891.1616816750001, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0320161213.json b/webextension/specs/fixtures/sync/rawPage0320161213.json index 4f7edbb5f..3aee3c872 100644 --- a/webextension/specs/fixtures/sync/rawPage0320161213.json +++ b/webextension/specs/fixtures/sync/rawPage0320161213.json @@ -4,7 +4,7 @@ "id": 621674333, "name": "Afternoon Hike", "emoji_name": "Afternoon Hike", - "type": "Hike", + "sport_type": "Hike", "display_type": "Hike", "activity_type_display_name": "Hike", "private": false, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 316.93608925920006, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 619567232, "name": "Perreree ", "emoji_name": "Perreree ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -83,7 +82,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 803.10777568, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 617435476, "name": "Perreree - Test garmin edge 1000", "emoji_name": "Perreree - Test garmin edge 1000", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -129,7 +127,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 743.857901065, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 606986080, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -175,7 +172,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 254.82177442000003, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 604927518, "name": "Skateboard from work :)", "emoji_name": "Skateboard from work :)", - "type": "InlineSkate", + "sport_type": "InlineSkate", "display_type": "Inline Skate", "activity_type_display_name": "Inline Skate", "private": true, @@ -221,7 +217,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 602887149, "name": "Les gouttes de justesse ", "emoji_name": "Les gouttes de justesse ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 910.5365962499999, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 600329531, "name": "Sheep Ride", "emoji_name": "Sheep Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -313,7 +307,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 885.5051874399999, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 597999523, "name": "4 Seigneurs x Vik + Murianette x Philippe", "emoji_name": "4 Seigneurs x Vik + Murianette x Philippe", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2425.26878594, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 590729223, "name": "Vercors Loop v2", "emoji_name": "Vercors Loop v2", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 3065.04674775, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 589653480, "name": "Col de Palaquit \u0026 Venon. Snakes on road :|", "emoji_name": "Col de Palaquit \u0026 Venon. Snakes on road :|", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2363.4040534650003, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 587738031, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 885.2925614000001, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 586561709, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 918.7275311999999, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 579068180, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 839.319807965, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 577940202, "name": "Variante apr\u00e8s Revel", "emoji_name": "Variante apr\u00e8s Revel", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1103.24115648, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 576928985, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 903.3583767749999, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 569640952, "name": "Pinet", "emoji_name": "Pinet", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1225.8160589999998, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 568441857, "name": "Saint Mury", "emoji_name": "Saint Mury", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1324.5440038299998, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 567394271, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 902.5986369600001, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 566288762, "name": "Tranquille ", "emoji_name": "Tranquille ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 465.007265625, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 565218522, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1293.9527545600001, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0420161213.json b/webextension/specs/fixtures/sync/rawPage0420161213.json index db16ccfe0..a61b9dce0 100644 --- a/webextension/specs/fixtures/sync/rawPage0420161213.json +++ b/webextension/specs/fixtures/sync/rawPage0420161213.json @@ -4,7 +4,7 @@ "id": 560069623, "name": "Chamrousse 1750", "emoji_name": "Chamrousse 1750", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1983.3313832150002, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 559166446, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -83,7 +82,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 883.7887107250001, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 558458998, "name": "Ptits balcons de Belledonne", "emoji_name": "Ptits balcons de Belledonne", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -129,7 +127,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1343.262671775, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 556443499, "name": "75k @ 31.5 KPH // 181 BPM", "emoji_name": "75k @ 31.5 KPH // 181 BPM", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1891.9872593999999, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 555456547, "name": "80k. Climb Challenge Done.", "emoji_name": "80k. Climb Challenge Done.", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -221,7 +217,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2033.1078621450001, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 553573871, "name": "Zwift Session", "emoji_name": "Zwift Session", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 599.426525475, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 552562511, "name": "Pererree 1.4", "emoji_name": "Pererree 1.4", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -313,7 +307,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 873.6673305600001, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 551497751, "name": "Perreree 1.3", "emoji_name": "Perreree 1.3", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1031.47978101, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 549238663, "name": "120k with froozen feet \u0026 rain ! Strong race with a doe !", "emoji_name": "120k with froozen feet \u0026 rain ! Strong race with a doe !", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2583.5442401399996, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 547228287, "name": "No punctures ! Woow !", "emoji_name": "No punctures ! Woow !", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1877.8029876, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 545304771, "name": "Roule et cr\u00e8ve ! All\u00e9 je change ce pneu de merde !", "emoji_name": "Roule et cr\u00e8ve ! All\u00e9 je change ce pneu de merde !", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 175.22342743999997, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 541369026, "name": "Chamrousse et Pschitt ! Putin de chambre \u00e0 valve courte ! Bien oui \u00e7a marche pas sur les Cosmics :/ Merci victor pour le sauvetage ;)", "emoji_name": "Chamrousse et Pschitt ! Putin de chambre \u00e0 valve courte ! Bien oui \u00e7a marche pas sur les Cosmics :/ Merci victor pour le sauvetage ;)", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1347.931685215, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 540223951, "name": "Pinet avec Vik", "emoji_name": "Pinet avec Vik", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1051.64121993, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 538490670, "name": "Perreree 1.2", "emoji_name": "Perreree 1.2", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 889.44487269, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 531863498, "name": "Perreree 1.1", "emoji_name": "Perreree 1.1", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 839.77991829, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 530939100, "name": "Perreree 1.0", "emoji_name": "Perreree 1.0", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 890.72468084, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 527288373, "name": "78k", "emoji_name": "78k", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1782.3066851799997, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 514962248, "name": "Get back on Aeroad CF", "emoji_name": "Get back on Aeroad CF", - "type": "Ride", + "sport_type": "Ride", "display_type": "Workout", "activity_type_display_name": "Ride", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 834.445288875, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 500553714, "name": "Zwift -Skiing crash return", "emoji_name": "Zwift -Skiing crash return", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 329.19999691000004, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 481714535, "name": "Petit Swisssssss ! Et bim une fesse en moins ! (Videos in description)", "emoji_name": "Petit Swisssssss ! Et bim une fesse en moins ! (Videos in description)", - "type": "AlpineSki", + "sport_type": "AlpineSki", "display_type": "Alpine Ski", "activity_type_display_name": "Alpine Ski", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0520161213.json b/webextension/specs/fixtures/sync/rawPage0520161213.json index ecac20255..90c9707ad 100644 --- a/webextension/specs/fixtures/sync/rawPage0520161213.json +++ b/webextension/specs/fixtures/sync/rawPage0520161213.json @@ -4,7 +4,7 @@ "id": 481131552, "name": "Porte du soleil - J1 (Std dh in desc)", "emoji_name": "Porte du soleil - J1 (Std dh in desc)", - "type": "AlpineSki", + "sport_type": "AlpineSki", "display_type": "Alpine Ski", "activity_type_display_name": "Alpine Ski", "private": false, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 476644193, "name": "7 Laux avec Natacha + Leslie - 120kph Hit @ youtu.be/Lc6SdTDiAj4", "emoji_name": "7 Laux avec Natacha + Leslie - 120kph Hit @ youtu.be/Lc6SdTDiAj4", - "type": "AlpineSki", + "sport_type": "AlpineSki", "display_type": "Alpine Ski", "activity_type_display_name": "Alpine Ski", "private": false, @@ -83,7 +82,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 473894759, "name": "Zwift Watopia Easy Spin Flat", "emoji_name": "Zwift Watopia Easy Spin Flat", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -129,7 +127,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 557.961169575, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 471564696, "name": "Right leg returns ! Snow Outside, Sweat Inside, Zwift crash :/", "emoji_name": "Right leg returns ! Snow Outside, Sweat Inside, Zwift crash :/", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 368.59069683999996, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 455024926, "name": "Muscle pain test comeback = fail", "emoji_name": "Muscle pain test comeback = fail", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -221,7 +217,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 112.45951548, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 443751030, "name": "Watopia PRs", "emoji_name": "Watopia PRs", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 711.8819411000001, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 442612867, "name": "Richmond Lap position @ 17% :D", "emoji_name": "Richmond Lap position @ 17% :D", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -313,7 +307,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 747.548499775, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 442080924, "name": "Zwift - Richmond, VA 11/30/2015", "emoji_name": "Zwift - Richmond, VA 11/30/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 608.0242804399999, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 440095526, "name": "Wake up ride :) ! Missed Laurens Ten Dam peloton :/", "emoji_name": "Wake up ride :) ! Missed Laurens Ten Dam peloton :/", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 552.9596085, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 439266355, "name": "SZR Group Ride", "emoji_name": "SZR Group Ride", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 798.9726064, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 438630212, "name": "Zwift - Richmond, VA - The Gorby Partial... :/", "emoji_name": "Zwift - Richmond, VA - The Gorby Partial... :/", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 342.237654, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 437387542, "name": "Zwift - Richmond, VA 11/22/2015", "emoji_name": "Zwift - Richmond, VA 11/22/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 858.925069275, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 436621314, "name": "Zwift First 70k on Watopia", "emoji_name": "Zwift First 70k on Watopia", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1597.9361032499999, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 435594326, "name": "Zwift - Watopia - Jon's Short Mix", "emoji_name": "Zwift - Watopia - Jon's Short Mix", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 374.30105672499997, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 435053107, "name": "Zwift - Watopia 11/18/2015", "emoji_name": "Zwift - Watopia 11/18/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 611.5573720200001, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 434882524, "name": "Fast Hometrainer session", "emoji_name": "Fast Hometrainer session", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -720,14 +705,12 @@ "elevation_gain": "0", "elevation_unit": "m", "elevation_gain_raw": 0, - "description": "200 calories burned", "activity_url": "https://www.strava.com/activities/434882524", "activity_url_for_twitter": "https://www.strava.com/activities/434882524?utm_content=2470979\u0026utm_medium=referral\u0026utm_source=twitter", "twitter_msg": "went for a 9.5 kilometer Ride.", "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -740,7 +723,7 @@ "id": 434544103, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +756,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 235.709637024, "feed_data": { "entries": [] }, @@ -786,7 +768,7 @@ "id": 433945020, "name": "Zwift - Richmond, VA 11/16/2015", "emoji_name": "Zwift - Richmond, VA 11/16/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -819,7 +801,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 655.13027862, "feed_data": { "entries": [] }, @@ -832,7 +813,7 @@ "id": 432548748, "name": "Petit Pinet malgr\u00e9 la cr\u00e8ve :/", "emoji_name": "Petit Pinet malgr\u00e9 la cr\u00e8ve :/", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -865,7 +846,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1540.28403144, "feed_data": { "entries": [] }, @@ -878,7 +858,7 @@ "id": 432040117, "name": "Zwift - Watopia 11/13/2015", "emoji_name": "Zwift - Watopia 11/13/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -911,7 +891,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 640.62999798, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0620161213.json b/webextension/specs/fixtures/sync/rawPage0620161213.json index 140eecdcb..0cbac57c7 100644 --- a/webextension/specs/fixtures/sync/rawPage0620161213.json +++ b/webextension/specs/fixtures/sync/rawPage0620161213.json @@ -4,7 +4,7 @@ "id": 431449241, "name": "Zwift - Watopia 11/12/2015", "emoji_name": "Zwift - Watopia 11/12/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -37,7 +37,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 378.89437616, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 431464624, "name": "Zwift - Watopia 11/12/2015 // Cut // Crashed app", "emoji_name": "Zwift - Watopia 11/12/2015 // Cut // Crashed app", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -83,7 +82,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 205.85531400000002, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 430765595, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -129,7 +127,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 864.2161869299999, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 430204077, "name": "Zwift - Richmond, VA - FTP Test (shorter)", "emoji_name": "Zwift - Richmond, VA - FTP Test (shorter)", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 450.4447289600001, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 429628737, "name": "Zwift - Richmond, VA 11/09/2015", "emoji_name": "Zwift - Richmond, VA 11/09/2015", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -221,7 +217,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 598.81470156, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 429009625, "name": "86k", "emoji_name": "86k", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1711.59159003, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 428142857, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -313,7 +307,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 850.272513175, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 427606185, "name": "1st zwift ride", "emoji_name": "1st zwift ride", - "type": "VirtualRide", + "sport_type": "VirtualRide", "display_type": "Virtual Ride", "activity_type_display_name": "Virtual Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 241.81931788, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 424565561, "name": "Chartreuse Rousse et Herbe fluo !!", "emoji_name": "Chartreuse Rousse et Herbe fluo !!", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1995.4309740800002, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 423706687, "name": "Couleurs d'Automne", "emoji_name": "Couleurs d'Automne", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 1831.93190544, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 420778529, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 193.535379065, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 420018674, "name": "Lunch Ride", "emoji_name": "Lunch Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 169.16904879999998, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 420020088, "name": "Lunch Ride", "emoji_name": "Lunch Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 199.9254575565, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 420019984, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 43.6032808725, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 420019949, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 191.92554674800002, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 417483106, "name": "Tafe", "emoji_name": "Tafe", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 259.563098955, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 420019810, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 76.197678375, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 420019708, "name": "Lunch Ride", "emoji_name": "Lunch Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 256.733509935, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 420019631, "name": "Morning Ride", "emoji_name": "Morning Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 102.91963569, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 406963466, "name": "Evening Run", "emoji_name": "Evening Run", - "type": "Run", + "sport_type": "Run", "display_type": "Workout", "activity_type_display_name": "Run", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 499.0554129600001, "feed_data": { "entries": [] }, diff --git a/webextension/specs/fixtures/sync/rawPage0720161213.json b/webextension/specs/fixtures/sync/rawPage0720161213.json index db44eeba8..7c0419806 100644 --- a/webextension/specs/fixtures/sync/rawPage0720161213.json +++ b/webextension/specs/fixtures/sync/rawPage0720161213.json @@ -4,7 +4,7 @@ "id": 406217194, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -37,7 +37,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 1106.41489917, "feed_data": { "entries": [] }, @@ -50,7 +49,7 @@ "id": 403560066, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -83,7 +82,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 873.9592777, "feed_data": { "entries": [] }, @@ -96,7 +94,7 @@ "id": 403560013, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -129,7 +127,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 827.3318955, "feed_data": { "entries": [] }, @@ -142,7 +139,7 @@ "id": 397193741, "name": "Canada diet week 01", "emoji_name": "Canada diet week 01", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -175,7 +172,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 850.8935213450001, "feed_data": { "entries": [] }, @@ -188,7 +184,7 @@ "id": 393874622, "name": "Tadoussac walk, QC, Canada", "emoji_name": "Tadoussac walk, QC, Canada", - "type": "Hike", + "sport_type": "Hike", "display_type": "Hike", "activity_type_display_name": "Hike", "private": false, @@ -221,7 +217,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 255.15407793600005, "feed_data": { "entries": [] }, @@ -234,7 +229,7 @@ "id": 393116784, "name": "Chicoutimi Run, QC, Canada", "emoji_name": "Chicoutimi Run, QC, Canada", - "type": "Run", + "sport_type": "Run", "display_type": "Workout", "activity_type_display_name": "Run", "private": false, @@ -267,7 +262,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 476.27322839999994, "feed_data": { "entries": [] }, @@ -280,7 +274,7 @@ "id": 392354127, "name": "Val Jalbert walk, QC, Canada", "emoji_name": "Val Jalbert walk, QC, Canada", - "type": "Hike", + "sport_type": "Hike", "display_type": "Hike", "activity_type_display_name": "Hike", "private": false, @@ -313,7 +307,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 311.450229648, "feed_data": { "entries": [] }, @@ -326,7 +319,7 @@ "id": 387847432, "name": "Ptite P\u00e9r\u00e9rr\u00e9e", "emoji_name": "Ptite P\u00e9r\u00e9rr\u00e9e", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -359,7 +352,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 837.6778021, "feed_data": { "entries": [] }, @@ -372,7 +364,7 @@ "id": 387059955, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -405,7 +397,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 709.0235271, "feed_data": { "entries": [] }, @@ -418,7 +409,7 @@ "id": 386268058, "name": "Empty", "emoji_name": "Empty", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -451,7 +442,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 209.11589958, "feed_data": { "entries": [] }, @@ -464,7 +454,7 @@ "id": 385490294, "name": "Afternoon Ride", "emoji_name": "Afternoon Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -497,7 +487,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 1278.17165112, "feed_data": { "entries": [] }, @@ -510,7 +499,7 @@ "id": 384884871, "name": "Test Cam | http://youtu.be/i2hHnrgTj_s + http://youtu.be/5D6ZcfpzO74", "emoji_name": "Test Cam | http://youtu.be/i2hHnrgTj_s + http://youtu.be/5D6ZcfpzO74", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -543,7 +532,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 826.09327545, "feed_data": { "entries": [] }, @@ -556,7 +544,7 @@ "id": 377946066, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -589,7 +577,6 @@ "is_new": true, "is_changing_type": false, "suffer_score": null, - "calories": 499.04194151999997, "feed_data": { "entries": [] }, @@ -602,7 +589,7 @@ "id": 377239233, "name": "Cram\u00e9 !!", "emoji_name": "Cram\u00e9 !!", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -635,7 +622,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 829.9940472, "feed_data": { "entries": [] }, @@ -648,7 +634,7 @@ "id": 375518033, "name": "MTB Chamrousse - GoPro @ http://youtu.be/C05qJKfJjmQ", "emoji_name": "MTB Chamrousse - GoPro @ http://youtu.be/C05qJKfJjmQ", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -681,7 +667,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 2317.84751838, "feed_data": { "entries": [] }, @@ -694,7 +679,7 @@ "id": 375518573, "name": "Evening Ride", "emoji_name": "Evening Ride", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -727,7 +712,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 431.79680508900003, "feed_data": { "entries": [] }, @@ -740,7 +724,7 @@ "id": 372761597, "name": "Rodage plaquettes", "emoji_name": "Rodage plaquettes", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -773,7 +757,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 282.40540485, "feed_data": { "entries": [] }, @@ -786,7 +769,7 @@ "id": 371317512, "name": "Fast Fast Fast \u0026 Pschitt", "emoji_name": "Fast Fast Fast \u0026 Pschitt", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -819,7 +802,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 997.8805605600002, "feed_data": { "entries": [] }, @@ -832,7 +814,7 @@ "id": 368210547, "name": "Natation", "emoji_name": "Natation", - "type": "Swim", + "sport_type": "Swim", "display_type": "Swim", "activity_type_display_name": "Swim", "private": false, @@ -865,7 +847,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": null, "feed_data": { "entries": [] }, @@ -878,7 +859,7 @@ "id": 367463594, "name": "Venon", "emoji_name": "Venon", - "type": "Ride", + "sport_type": "Ride", "display_type": "Ride", "activity_type_display_name": "Ride", "private": false, @@ -911,7 +892,6 @@ "is_new": false, "is_changing_type": false, "suffer_score": null, - "calories": 956.592687015, "feed_data": { "entries": [] }, diff --git a/webextension/specs/sync/activities-sync-basics.spec.ts b/webextension/specs/sync/activities-sync-basics.spec.ts index f8dd349fd..a5207f6a7 100644 --- a/webextension/specs/sync/activities-sync-basics.spec.ts +++ b/webextension/specs/sync/activities-sync-basics.spec.ts @@ -22,7 +22,9 @@ describe("ActivitiesSynchronize", () => { }); it("should remove activity from array properly ", done => { - let rawPageOfActivities: Array = _.cloneDeep(require("../fixtures/sync/rawPage0120161213.json").models); + let rawPageOfActivities: Array = _.cloneDeep( + require("../fixtures/sync/rawPage0120161213.json").models + ); const sourceCount = rawPageOfActivities.length; rawPageOfActivities = removeActivityFromArray(722210052, rawPageOfActivities); // Remove Hike "Fort saint eynard" @@ -34,16 +36,18 @@ describe("ActivitiesSynchronize", () => { }); it("should edit activity from array properly ", done => { - let rawPageOfActivities: Array = _.cloneDeep(require("../fixtures/sync/rawPage0120161213.json").models); + let rawPageOfActivities: Array = _.cloneDeep( + require("../fixtures/sync/rawPage0120161213.json").models + ); const sourceCount = rawPageOfActivities.length; rawPageOfActivities = editActivityFromArray(722210052, rawPageOfActivities, "New_Name", "Ride"); // Edit Hike "Fort saint eynard" expect(rawPageOfActivities).not.toBeNull(); - const foundBack: Activity = _.find(rawPageOfActivities, { id: 722210052 }); + const foundBack: StravaActivityModel = _.find(rawPageOfActivities, { id: 722210052 }); expect(foundBack).toBeDefined(); expect(foundBack.name).toEqual("New_Name"); - expect(foundBack.type).toEqual("Ride"); + expect(foundBack.sport_type).toEqual("Ride"); expect(rawPageOfActivities.length).toEqual(sourceCount); done(); }); diff --git a/webextension/specs/sync/activities-sync-stubed.spec.ts b/webextension/specs/sync/activities-sync-stubed.spec.ts index 6633479d5..bacf8d89a 100644 --- a/webextension/specs/sync/activities-sync-stubed.spec.ts +++ b/webextension/specs/sync/activities-sync-stubed.spec.ts @@ -154,7 +154,7 @@ describe("ActivitiesSynchronize", () => { const activityComputed: Activity = new Activity(); activityComputed.id = streamActivityModel.id; activityComputed.name = streamActivityModel.name; - activityComputed.type = streamActivityModel.type as ElevateSport; + activityComputed.type = streamActivityModel.sport_type as ElevateSport; activityComputed.startTimestamp = startTimestamp; activityComputed.endTimestamp = endTimestamp; activityComputed.startTime = streamActivityModel.start_time; @@ -171,7 +171,7 @@ describe("ActivitiesSynchronize", () => { activityComputed.stats.elapsedTime = streamActivityModel.elapsed_time_raw; activityComputed.stats.distance = streamActivityModel.distance_raw; activityComputed.stats.moveRatio = activityComputed.stats.movingTime / activityComputed.stats.elapsedTime; - activityComputed.stats.calories = streamActivityModel.calories; + // activityComputed.stats.calories = streamActivityModel.calories; activityComputed.stats.caloriesPerHour = activityComputed.stats.calories !== null ? (activityComputed.stats.calories / activityComputed.stats.elapsedTime) * Constant.SEC_HOUR_FACTOR @@ -276,7 +276,7 @@ describe("ActivitiesSynchronize", () => { const burnedRide: StravaActivityModel = _.find(rawStravaActivities, { id: 377239233 }); // Find in page 1 expect(burnedRide.name).toEqual("Cramé !!"); - expect(burnedRide.type).toEqual("Ride"); + expect(burnedRide.sport_type).toEqual("Ride"); expect(burnedRide.moving_time_raw).toEqual(4315); const fakeRide: StravaActivityModel = _.find(rawStravaActivities, { id: 9999999999 }); // Find in page 1 @@ -765,8 +765,8 @@ describe("ActivitiesSynchronize", () => { ).toBeTruthy(); // Page 7, "Rodage plaquettes" expect(_.find(rawPagesOfActivities[2].models, { id: 569640952 }).name).toEqual("Petit nez!"); - expect(_.find(rawPagesOfActivities[6].models, { id: 372761597 }).type).toEqual("EBike"); - expect(_.find(rawPagesOfActivities[0].models, { id: 707356065 }).type).not.toEqual("EBike"); + expect(_.find(rawPagesOfActivities[6].models, { id: 372761597 }).sport_type).toEqual("EBike"); + expect(_.find(rawPagesOfActivities[0].models, { id: 707356065 }).sport_type).not.toEqual("EBike"); /** * Delete 5 on various pages diff --git a/webextension/specs/tools/specs-tools.ts b/webextension/specs/tools/specs-tools.ts index 67fc79625..a37647e2e 100644 --- a/webextension/specs/tools/specs-tools.ts +++ b/webextension/specs/tools/specs-tools.ts @@ -20,6 +20,6 @@ export const editActivityFromArray = ( const a: any = _.find(fromArray, predicate); a.name = newName; - a.type = newType; + a.sport_type = newType; return fromArray; }; From 9c397fc57f6972bab7fc7892e562b58b7d4fcb9a Mon Sep 17 00:00:00 2001 From: Thomas Champagne Date: Sun, 3 Nov 2024 12:51:07 +0100 Subject: [PATCH 2/2] Bump version --- .husky/pre-commit | 64 +------------------ .../shared/sync/compute/activity-computer.ts | 1 - appcore/package-lock.json | 4 +- appcore/package.json | 2 +- desktop/package-lock.json | 4 +- desktop/package.json | 2 +- package-lock.json | 4 +- package.json | 4 +- webextension/manifest.json | 4 +- webextension/package-lock.json | 4 +- webextension/package.json | 2 +- 11 files changed, 16 insertions(+), 79 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index a1fe9b459..d4ae0b203 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,63 +1 @@ -#!/bin/sh - -if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then - set -x -fi - -if [ "$LEFTHOOK" = "0" ]; then - exit 0 -fi - -call_lefthook() -{ - if test -n "$LEFTHOOK_BIN" - then - "$LEFTHOOK_BIN" "$@" - elif lefthook.exe -h >/dev/null 2>&1 - then - lefthook.exe "$@" - elif lefthook.bat -h >/dev/null 2>&1 - then - lefthook.bat "$@" - else - dir="$(git rev-parse --show-toplevel)" - osArch=$(uname | tr '[:upper:]' '[:lower:]') - cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') - if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" - then - "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" - then - "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@" - elif test -f "$dir/node_modules/lefthook/bin/index.js" - then - "$dir/node_modules/lefthook/bin/index.js" "$@" - - elif bundle exec lefthook -h >/dev/null 2>&1 - then - bundle exec lefthook "$@" - elif yarn lefthook -h >/dev/null 2>&1 - then - yarn lefthook "$@" - elif pnpm lefthook -h >/dev/null 2>&1 - then - pnpm lefthook "$@" - elif swift package plugin lefthook >/dev/null 2>&1 - then - swift package --disable-sandbox plugin lefthook "$@" - elif command -v mint >/dev/null 2>&1 - then - mint run csjones/lefthook-plugin "$@" - elif command -v npx >/dev/null 2>&1 - then - npx lefthook "$@" - else - echo "Can't find lefthook in PATH" - fi - fi -} - -call_lefthook run "pre-commit" "$@" +npm run prettier diff --git a/appcore/modules/shared/sync/compute/activity-computer.ts b/appcore/modules/shared/sync/compute/activity-computer.ts index 495a870ab..ec796793a 100644 --- a/appcore/modules/shared/sync/compute/activity-computer.ts +++ b/appcore/modules/shared/sync/compute/activity-computer.ts @@ -979,7 +979,6 @@ export class ActivityComputer { ) : null; - // Efficiency scores.efficiency = stats?.power?.weighted && stats?.heartRate?.avg diff --git a/appcore/package-lock.json b/appcore/package-lock.json index 57c2740c9..48baa148a 100644 --- a/appcore/package-lock.json +++ b/appcore/package-lock.json @@ -1,12 +1,12 @@ { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { diff --git a/appcore/package.json b/appcore/package.json index a8472121b..5e805adad 100644 --- a/appcore/package.json +++ b/appcore/package.json @@ -1,6 +1,6 @@ { "name": "elevate-sports-app", - "version": "7.2.0", + "version": "7.2.1", "license": "MPL-2.0", "scripts": { "ng": "ng", diff --git a/desktop/package-lock.json b/desktop/package-lock.json index c317d4153..852ea065f 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "license": "MPL-2.0", "dependencies": { "@thomaschampagne/sports-lib": "^6.1.1", diff --git a/desktop/package.json b/desktop/package.json index 8a0180967..86862757a 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,7 +1,7 @@ { "name": "elevate-sports-app", "description": "Elevate your training experience and goals! Track your fitness and progressions over time. Analyse deeper your activities. And more...", - "version": "7.2.0", + "version": "7.2.1", "scripts": { "assert-app-exists": "node -e \"if ((require('fs').existsSync('./dist/app/')) === false) {console.log('Please run & wait for \\'npm start\\' task before.\\n\\n\\n\\n');process.exit(1);}\";", "build:metadata": "node -e \"require('fs').writeFileSync('build_metadata.json', JSON.stringify({commit: require('child_process').execSync('git rev-parse HEAD').toString().trim(), date: new Date().toISOString()}));\"", diff --git a/package-lock.json b/package-lock.json index 5769e3b69..7557feef1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "elevate-sports-app", - "version": "7.2.0", + "version": "7.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elevate-sports-app", - "version": "7.2.0", + "version": "7.2.1", "hasInstallScript": true, "license": "MPL-2.0", "devDependencies": { diff --git a/package.json b/package.json index 3551b3518..c6000b39d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elevate-sports-app", - "version": "7.2.0", + "version": "7.2.1", "description": "Wrap the needed tools required to cook Elevate desktop and web extension", "maintainers": [ { @@ -34,7 +34,7 @@ "wipe": "npm run clean && npm run wipe:package-locks && npm run wipe:node-modules", "wipe:node-modules": "node ./node_modules/del-cli/cli.js ./node_modules/ ./appcore/node_modules/ ./desktop/node_modules/ ./webextension/node_modules/", "wipe:package-locks": "node ./node_modules/del-cli/cli.js ./package-lock.json ./appcore/package-lock.json ./desktop/package-lock.json ./webextension/package-lock.json", - "prepare": "husky install" + "prepare": "husky" }, "config": { "unsafe-perm": true diff --git a/webextension/manifest.json b/webextension/manifest.json index 000107683..ea38ce4d0 100644 --- a/webextension/manifest.json +++ b/webextension/manifest.json @@ -3,8 +3,8 @@ "name": "Elevate for Strava", "short_name": "Elevate", "description": "Elevate your strava experience and goals! Track your fitness and progressions over time. Analyse deeper your activities. And more...", - "version": "7.2.0", - "version_name": "7.2.0", + "version": "7.2.1", + "version_name": "7.2.1", "background": { "service_worker": "extension/service_worker.bundle.js", "type": "module" diff --git a/webextension/package-lock.json b/webextension/package-lock.json index 0d018e5d7..f7a8a4443 100644 --- a/webextension/package-lock.json +++ b/webextension/package-lock.json @@ -1,12 +1,12 @@ { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "elevate-sports-app", - "version": "7.1.0", + "version": "7.2.1", "license": "MPL-2.0", "dependencies": { "@elevate/shared": "file:../appcore/modules/shared/", diff --git a/webextension/package.json b/webextension/package.json index f842e72eb..30e1237bb 100644 --- a/webextension/package.json +++ b/webextension/package.json @@ -1,6 +1,6 @@ { "name": "elevate-sports-app", - "version": "7.2.0", + "version": "7.2.1", "description": "Chrome based extension adding features for Strava website with new performances data and improved ergonomics.", "maintainers": [ {