Strava Download - Map VirtualRun and VirtualRide to Run and Ride

Use SubSport to preserve the original type when Sport is mapped.
Fixes #3278
This commit is contained in:
Ale Martinez
2020-01-01 15:07:40 -03:00
parent 4b53b24669
commit 8d6ea4fa72

View File

@@ -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)