omriasta / ifitsync

Python script to sync iFIT data to your Google Fit Account
GNU General Public License v3.0
35 stars 5 forks source link

IndexError: list index out of range #9

Open fitig opened 2 years ago

fitig commented 2 years ago

I get this error when uploading a workout. I believe this is a workout that was captured in the ifit app on a phone rather than from a treadmill itself. Here is the actual error output:

_Uploaded Body Weight HIIT Workout Calorie data successfully Traceback (most recent call last): File "ifitsync/ifitsync.py", line 691, in UploadIfitDistanceToGoogle(y) File "ifitsync/ifitsync.py", line 314, in UploadIfitDistanceToGoogle

I'm having a hard time figuring out which value Google isn't liking. Do you mind pointing me in the right direction?

omriasta commented 2 years ago

The function that is erroring out is the portion that uploads the distance that you ran at intervals. I'm guessing that maybe this workout didn't create a list for this metric? I can't say for sure without seeing the json that the script is retrieving.

omriasta commented 2 years ago

One suggestion to bypass this error would be to comment out line 691 which will let the script continue without uploading this metric. If the issue is only this metric, the script should complete successfully and won't try to reupload this workout. If it continues to fail, you can comment out the functions that error until you get it to complete.

fitig commented 2 years ago

<shamelessly stealing from the code you provided in issue 8> Here is the history.json and stats.json. Does anything stick out?

stats_and_history_json.zip

omriasta commented 2 years ago

Yep, if you look at the stats as well as the totals in those files, the only thing that ifit is storing is calories. It has distance, HR, speed etc all at 0. If you look at the stats, it should have a list like calories does for all the other metrics....