jimmykane / fit-parser

Parse your FIT files easily, directly from JS (Garmin, Polar, Suunto)
Other
92 stars 33 forks source link

Support of "summary first" for Garmin upcoming changes #31

Closed collax closed 11 months ago

collax commented 1 year ago

https://forums.garmin.com/developer/fit-sdk/b/news-announcements/posts/important-fit-activity-file-message-change

After the 1s December, Garmin will save the files with the "summary first" method instead of the "summary last". Using their example file, I don't seem to be able to get the data inside the sessions? Are the files using the summary first method supported?

gie3d commented 1 year ago

@collax I face the same issue as you. I normally use cascade mode when I parse my fit files.

My workaround would be changing to list mode. In list mode, you won't get the parent-child relationship between sessions, laps and records. But given the timestamp, in sessions, laps and records, I think, you could re-group them again.

krzysztof-cislo commented 1 year ago

@jimmykane do you think you will be able to fix the issue before December? Or this project is abandoned for you?

jimmykane commented 1 year ago

It's not abandoned but I have 0 time at the moment due to family issues and health. Unfortunately

Could you help ?

On Wed, 8 Nov 2023, 10:56 am Krzysztof Cisło, @.***> wrote:

@jimmykane https://github.com/jimmykane do you think you will be able to fix the issue before December? Or this project is abandoned for you?

— Reply to this email directly, view it on GitHub https://github.com/jimmykane/fit-parser/issues/31#issuecomment-1801352171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVX47TR7EMUJFYYFGKXUDYDNCMHAVCNFSM6AAAAAA6VZTXXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBRGM2TEMJXGE . You are receiving this because you were mentioned.Message ID: @.***>

gie3d commented 1 year ago

@jimmykane I'll look into this issue. Maybe this or next week. My idea would be changing the logic for cascade. Because the main different between Summary First and Summary Last is the sequence of message and the timestamp. I think rather than push the data into temp and fromtemp into its parent inside the main while loop. I might create a new while loop to create parent child relation.

If you have any suggestion, please let me know :)

I'll try to implement and test this and then submit a PR.

And thank you very much for creating this project :)

krzysztof-cislo commented 1 year ago

@gie3d did you find some time to look at this issue?

gie3d commented 1 year ago

@gie3d did you find some time to look at this issue?

Yes I submitted my pull request. I think @jimmykane might not be able to review it at the moment. In that case, I think you might review from the PR mentioned above if it could solve the problem and create a new package yourself.

krzysztof-cislo commented 1 year ago

@gie3d did you find some time to look at this issue?

Yes I submitted my pull request. I think @jimmykane might not be able to review it at the moment. In that case, I think you might review from the PR mentioned above if it could solve the problem and create a new package yourself.

Thanks! I will check the PR till EOW. Thanks again!

jimmykane commented 12 months ago

Guys feel free to close this

krzysztof-cislo commented 12 months ago

I did some tests and unfortunately after upgrade to 1.9.4 the the output is different...

I used example multisport files from garmin announcment: https://forums.garmin.com/developer/fit-sdk/b/news-announcements/posts/important-fit-activity-file-message-change

In short when I parse these files (summary first and summary last) with both mode session object doesn't contain laps. Laps are in the fit object on the top level, next to sessions but they are not in the tree...

@gie3d can you verify it?

gie3d commented 12 months ago

@krzysztof-cislo, you're right. There seems to be a problem in my code... will check and fix.

gie3d commented 12 months ago

PR Submitted (https://github.com/jimmykane/fit-parser/pull/33)

I also produce a sample output from the program.

https://github.com/jimmykane/fit-parser/files/13427906/Archive.zip

gie3d commented 12 months ago

@krzysztof-cislo @jimmykane I submitted the PR (#33) also with the json files generated from this and previous version. I'd be great if you guys could double check. I have a very limited number of fit files to test.

krzysztof-cislo commented 12 months ago

@krzysztof-cislo @jimmykane I submitted the PR (#33) also with the json files generated from this and previous version. I'd be great if you guys could double check. I have a very limited number of fit files to test.

@gie3d I checked the PR and the output. Please look at the PR.

gie3d commented 12 months ago

@jimmykane Would it be possible if you could review the PR (#33), merge and release again to fix the problem found on the previous version. This time, it would be more robust as @krzysztof-cislo also help testing it.

jimmykane commented 12 months ago

1.9.5 is out

krzysztof-cislo commented 12 months ago

Thank you @gie3d and @jimmykane !

jimmykane commented 12 months ago

Did almost nothing so big thanks goes to @gie3d

gie3d commented 11 months ago

@collax have you tried 1.9.5 if it's ok then you may close this issue.

collax commented 11 months ago

@gie3d I will test it this weekend, thanks !

collax commented 11 months ago

Alright it seem to work fine with the example Garmin file. Thanks a lot !