pe-st / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
374 stars 77 forks source link

Add a new option to stop further downloads after duplicate occurs #76

Open bxsx opened 2 years ago

bxsx commented 2 years ago

Summary

This PR adds a new option --exitondup (shortcut: -x) which stops further downloads of activities when a duplicate occurs.

Motivation

This feature saves bandwidth and processing time in case the user only wants to download the latest activities to the directory where the older activities are located.

Old behavior / without --exitondup

Welcome to Garmin Connect Exporter!
[WARNING] Output directory /garmin/ already exists. Will skip already-downloaded files and append to the CSV file.
Connecting to Garmin Connect... Done.
Requesting Login ticket... Done. Ticket=
Authenticating... Done.
Getting display name... Done. displayName=
Fetching user stats... Done.
Querying list of activities 1..100... Done.
Downloading: Garmin Connect activity (1/100) [...] ...
    ...
        Original data file already exists; skipping...
Downloading: Garmin Connect activity (2/100) [...] ...
        ...
    Original data file already exists; skipping...
Downloading: Garmin Connect activity (3/100) [...] ...
        ...
    Original data file already exists; skipping...
Downloading: Garmin Connect activity (4/100) [...] ...
        ...

With --exitondup

Welcome to Garmin Connect Exporter!
[WARNING] Output directory /garmin/ already exists. Will skip already-downloaded files and append to the CSV file.
Connecting to Garmin Connect... Done.
Requesting Login ticket... Done. Ticket=
Authenticating... Done.
Getting display name... Done. displayName=
Fetching user stats... Done.
Querying list of activities 1..100... Done.
Downloading: Garmin Connect activity (1/100) [...] ...
    ...
        Original data file already exists; skipping...
--exitondup flag enabled. Skipping the remaining activities.
Done!

Notes

This feature does not check if older activities are missing. Once a single file already exists it finishes the job. That's it.

telemaxx commented 2 years ago

good idea! I will try to integrate this in my fork...

bxsx commented 8 months ago

@pe-st any plans to merge it? I can update the branch and resolve conflicts..

pe-st commented 8 months ago

Hello @bxsx , sorry, I ignored this PR. I'll integrate it if you can update it, thanks already!