Add Watch/Computer Gear Type with Auto-Detection and Activity Linking #493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I apologise if this does not meet the normal quality, this is my second ever PR. It is intended to bring a missing feature but I won't be offended if you don't like it. Perhaps you will need to adjust my code and use only bits of it. Either way, I have tested it and it works for me with the three or four devices I have and I hope it will be valuable for others.
Summary
Adds a new gear type "Watch/Computer" (type 9) that automatically detects and tracks the recording device when importing activities. The system now distinguishes between equipment gear (shoes, bikes) and the recording device (watch, bike computer) that captured the activity.
Key Features
Auto-Detection & Linking
Frontend Updates
Database Changes (Alembic migration v0_17_0)
Auxiliary Scripts
Import Flow
FIT file imported
Tested With
You have to manually extract the fit files from your downloaded archive first, put them in the bulk import folder and in the case of Garmin, find the summarizedActivities.json for activity name matching and put that there as well.
Regarding the scripts: The first script (clean_duplicates.py) runs and splits out the health data into a health folder (retained under the bulk export folder), deletes the duplicates and retains the fit files for bulk import. The other thing I noticed was that exercises taken indoors without gps co-ordinates didn't get converted to fit files by Runalyzer.com meaning this history was lost. So, there's a second script in the aux-scripts to handle this (convert_json_to_fit.py. Both of these scripts operate directly out of their respective directories i.e files are converted directly from within the ophaned folder and put back into the bulk imports folder once converted.
I hope you get some value out of this and let me know if you need anything further. If we can get this one done, perhaps we can get health import done next. ;)
Regards,
Marshalleq