ebrithiljonas / fittrackee-uploader

A companion application for FitTrackee to upload your workout files
GNU Affero General Public License v3.0
14 stars 4 forks source link

No GPS data .fit file breaks fittrackee-uploader #1

Closed xmgz closed 1 year ago

xmgz commented 1 year ago

Hi

related to this problem when trying to upload a .fit file from garmin device using fittrackee-uploader.

So far I've had no problem when uploading .fit files containing gps data, but I also record indoor cycling activities that have no gps data attached.

When I run your program it inmediatly closes with this error message:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/__main__.py", line 3, in <module>
    ul = uploader.Uploader()
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 40, in __init__
    self.loadFolder()
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 87, in loadFolder
    self.loadNextFile()
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 101, in loadNextFile
    self.loadFile(file_path)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 93, in loadFile
    self.setMap(self.current_workout)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 113, in setMap
    m.fit_bounds(wo.getExtent())
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/workout/workout.py", line 12, in getExtent
    min_lat = self.points[0].getLat()
IndexError: list index out of range

above message resulted when I tried to upload this attached .fit file 2023-02-25-08-47-33.zip

Note: when I try to upload a .gpx also without gps data FitTrackee does not accept it. So I have to create a manual activity without gps selecting Cycling (Virtual) as activity type.

Other kind of activities, like strength training, crossfit, cardio, ... are not available yet to be selected on FitTrackee, but I guess .fit file from Indoor Cycling has some data to match FitTrackee presets for Cycling (Virtual) (i.e.: total time, distance at least).

Thank you for your work. Let me know if you need more context or data.

ebrithiljonas commented 1 year ago

Thanks for reporting it and providing me with a sample file. I added support for files without GPS records now. It even shows a text that there are no records instead of showing a map. Please let me know if you encounter any problems while uploading them, it might be that I have missed a few edge cases as I only had your one file to test it.

xmgz commented 1 year ago

Solved :+1: