piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
101 stars 51 forks source link

Calories are not shown correctly in strava. Add steps to the tcx file #343

Closed juanro49 closed 3 months ago

juanro49 commented 5 months ago

In the latest versions I've seen that calories are not shown correctly in Strava. Reviewing the created .tcx file from Amazfish, I've seen that the Calories tag is being created off the Lap tag instead of inside, which causes the problem.

image

On top of that, could the Steps tag be added for the steps? According to the scheme, it could be done by creating this structure inside the Lap structure

<Extensions>
<LX xmlns="http://www.garmin.com/xmlschemas/ActivityExtension/v2">
<Steps>000000</Steps> <!-- Number of steps -->
</LX>
</Extensions>
jmlich commented 4 months ago

Can you please verify if it works properly with pull request https://github.com/piggz/harbour-amazfish/pull/345 I am not using strava so I am not able to tell if this works properly.

juanro49 commented 4 months ago

Can you please verify if it works properly with pull request #345 I am not using strava so I am not able to tell if this works properly.

Thanks! I have compiled and installed a version with that correction and also added the step section, attached it in case you want to add it to the pull request. Tomorrow I'll try to see if the calories and steps are properly exported and I'll confirm it around again.

//Steps
    m = m_summary.metaData("steps");
    if (m.key == "steps") {
        out << "<Extensions>" << endl;
        out << "  <LX xmlns=\"http://www.garmin.com/xmlschemas/ActivityExtension/v2\">" << endl;
        out << "    <Steps>" << m.value << "</Steps>" << endl;
        out << "  </LX>" << endl;
        out << "</Extensions>" << endl;
    }

imagen

juanro49 commented 4 months ago

I can confirm that with the pull request correction, calories are already displayed correctly on Strava.

Also, with what I added about the steps, they are already shown in the TCX file, but as far as I have been able to see, Strava does not take the steps data from TCX at the moment. I have opened a support ticket for them to consider the option. https://support.strava.com/hc/es-es/requests/2831801

imagen

To follow the order of the schemes, I moved the Extensions structure for steps under Tracks in the code of the version I generated for testing purposes

//Steps
    m = m_summary.metaData("steps");
    if (m.key == "steps") {
        out << "<Extensions>" << endl;
        out << "  <LX xmlns=\"http://www.garmin.com/xmlschemas/ActivityExtension/v2\">" << endl;
        out << "    <Steps>" << m.value << "</Steps>" << endl;
        out << "  </LX>" << endl;
        out << "</Extensions>" << endl;
    }

imagen