From 9072333a3c6854a9b82a916b6d64d5050a76319e Mon Sep 17 00:00:00 2001 From: fachleitner Date: Sat, 7 Nov 2020 07:58:22 +0100 Subject: [PATCH] relax file name matching for downloaded fit files Seems like Garmin has changed the naming scheme of `.fit` files within the zip download when getting the original activity. The scheme used to be `{activity_id}.fit.` but has been changed to `{activity_id}_ACTIVITY.fit`. This commit relaxes the name comparison. --- garminexport/garminclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garminexport/garminclient.py b/garminexport/garminclient.py index 0c354f7..f8fbda6 100755 --- a/garminexport/garminclient.py +++ b/garminexport/garminclient.py @@ -335,7 +335,7 @@ class GarminClient(object): zip_file = zipfile.ZipFile(BytesIO(response.content), mode="r") for path in zip_file.namelist(): fn, ext = os.path.splitext(path) - if fn == str(activity_id): + if fn.startswith(str(activity_id)): return ext[1:], zip_file.open(path).read() return None, None