From 8d6ea4fa72c5eff4afd62cf89374cd676692cfb4 Mon Sep 17 00:00:00 2001 From: Ale Martinez Date: Wed, 1 Jan 2020 15:07:40 -0300 Subject: [PATCH] Strava Download - Map VirtualRun and VirtualRide to Run and Ride Use SubSport to preserve the original type when Sport is mapped. Fixes #3278 --- src/Cloud/Strava.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Cloud/Strava.cpp b/src/Cloud/Strava.cpp index c20275d17..0b339ac98 100644 --- a/src/Cloud/Strava.cpp +++ b/src/Cloud/Strava.cpp @@ -862,10 +862,12 @@ Strava::prepareResponse(QByteArray* data) // what sport? if (!each["type"].isNull()) { QString stype = each["type"].toString(); - if (stype == "Ride") ride->setTag("Sport", "Bike"); - else if (stype == "Run") ride->setTag("Sport", "Run"); - else if (stype == "Swim") ride->setTag("Sport", "Swim"); + if (stype.endsWith("Ride")) ride->setTag("Sport", "Bike"); + else if (stype.endsWith("Run")) ride->setTag("Sport", "Run"); + else if (stype.endsWith("Swim")) ride->setTag("Sport", "Swim"); else ride->setTag("Sport", stype); + // Set SubSport to preserve the original when Sport was mapped + if (stype != ride->getTag("Sport", "")) ride->setTag("SubSport", stype); } if (each["device_name"].toString().length()>0)