alex-hhh / ActivityLog2

Analyze data from swim, bike and run activities
https://alex-hhh.github.io/
GNU General Public License v3.0
340 stars 25 forks source link

Heart rate data is lost after joining or splitting a swim lap. #79

Closed idealist1508 closed 3 years ago

alex-hhh commented 3 years ago

This happens because I didn't consider HR data in the edit-lap-swim editor. This was written long before there was a capability to collect HR data on swims and I only got a watch that can read HR data recently....

Anyway, the way the functions join-lengths and split-length, along with all the helper functions will need to take into account that a length can have multiple trackpoints, which are the table rows that hold data, and re-assign these track points rather than delete them (the track points are deleted in delete-length).

I will need to look into more detail, since, for lap swimming activities which don't have HR data, the lengths contain a single track point at the end of the lap which holds the speed for that length...

alex-hhh commented 3 years ago

Hi @idealist1508 , I attempted to fix this issue in the following branch: https://github.com/alex-hhh/ActivityLog2/tree/ah/pr79-a

Can you give it a try and see if it works for you? I would recommend you backup your database first...

idealist1508 commented 3 years ago

Awesome! Works! I tested it in DB with only one Activity. I have not noticed any problems in db.