ErgDB-Import

52 views
Skip to first unread message

Joachim Kohlhammer

unread,
Jun 6, 2022, 3:07:39 AM6/6/22
to golden-cheetah-developers
Dear all,

when importing workouts from ErgDB, I see some issues in Golden Cheetah:
  • The names coming from ErgDB are HTML-encoded, making many of them hard to read in the Train-Views sidebar
  • Some names contain slashes (/), making it impossible to import these files (both Linux and Windows)
  • Some workouts have duplicate names, allowing only one of them to be stored in Golden Cheetah

I have implemented something I consider a solution to these issues:
  • The titles are HTML-decoded both in ErgDBDownloadDialog and ErgFile (here also copied to the field Name)
  • Filesystem: All ErgDB-workouts are stored as ergb-<ergdbID>.erg2
  • TrainDB: The decoded title is stored in the column "workouts.filename" instead of the real filename
  • Recorded CSV: An optional metadata section above the payload was added (format: "# <Key>:<Value>") to allow the Route-Tag to be set correctly when importing the data

Drawback of my solution:
  • I had to manually remove all "old" ErgDB-workouts from the TrainDB and the filesystem to prevent duplication

If there is interest in my changes, I would be happy to provide a pull request.

Regards
 Joachim

Ale Martinez

unread,
Dec 1, 2022, 8:26:48 AM12/1/22
to golden-cheetah-developers
You are right, HTML encoded titles are a PITA, but I am not comfortable with a change in DB schema and CSV format at this point of the release cycle, so I implemented a lesser solution in https://github.com/GoldenCheetah/GoldenCheetah/commit/d871b97e55a505bd9b1681035428f4f4db5530c4, hope it helps.
PS: I missed this before, sorry.
Ale.

Joachim Kohlhammer

unread,
Dec 1, 2022, 9:14:11 AM12/1/22
to golden-cheetah-developers
Ale Martinez schrieb am Donnerstag, 1. Dezember 2022 um 14:26:48 UTC+1:
You are right, HTML encoded titles are a PITA, but I am not comfortable with a change in DB schema and CSV format at this point of the release cycle, so I implemented a lesser solution in https://github.com/GoldenCheetah/GoldenCheetah/commit/d871b97e55a505bd9b1681035428f4f4db5530c4, hope it helps.
I fully agree that now is the complete wrong moment to add such a change. So lets go into discussion after 3.6 is released. Additionally I have some more features ready I would like to propose - including a filter functionality for workouts (by if, tss, name, duration, ...). But lets talk for 3.7
 
PS: I missed this before, sorry.
No problem, I really appreciate the effort you put into Golden Cheetah!
Reply all
Reply to author
Forward
0 new messages