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

[Feature Request] Skip button / Automatically Skip file #2

Closed xmgz closed 1 year ago

xmgz commented 1 year ago

First: I'm grateful you've made this tool and don't want to start asking features to fill all posible kind of files, or solve my problems, I just want to contribute with feedback.

Request: add skip button near upload button to avoid upload non valid files OR automatilly skip when the file has no distance (shown in your interface as 0.00 km) so fittrackee-uploader can continue uploading files instead of stop working.

I'm not asking to be able to upload this files, because FitTrackee does not support them yet, just to be able to manage its presence in the folder to upload. Usually there are many files in the upload folder from all kind of activities.

At this moment FitTrackee does not support adding (any of the available types) workout without giving a Distance value in the web form (as you can test), so fittrackee-uploader should manage this situation.

These are three diferent .fit files you can use to test, from diferent activities that for any reason have not distance in their content (fitness/cardio, breathing, cycling witout distance recorded from device)

All three fail with fittrackee-uploader.

Archive.zip

thank you

from terminal:

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 42, in __init__
    self.loadFolder()
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 89, in loadFolder
    self.loadNextFile()
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 103, in loadNextFile
    self.loadFile(file_path)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/uploader.py", line 93, in loadFile
    self.current_workout = self.loader.loadFile(path)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/workout/loader.py", line 20, in loadFile
    return self.filetypes[extension](path)
  File "/home/username/git/fittrackee-uploader/fittrackee-uploader/workout/fit.py", line 32, in __init__
    self.distance = frame.get_value('total_distance') / 1000
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
ebrithiljonas commented 1 year ago

Thanks for the request, this is a very useful feature. I added a skip button, with it you can skip every file you want. And I made it so when a file failed to load, instead of a crash, it shows now that it failed to load. Plus if you enable auto skipping in the settings, failed files will automatically be skipped.