Several bugfixes and improvements

Bugfix: Fixed a bug where a new year or month would crash the workoutrecorder due to a missing data directory

Several improvements:
* Added possibility of only creating RowingData file
* Improved HRR data when restarting a workout
This commit is contained in:
Jaap van Ekris 2023-01-10 11:27:13 +01:00 committed by GitHub
parent 51400f2c02
commit 6623aa2f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -87,6 +87,14 @@ function createWorkoutRecorder () {
`"${currentstroke.driveHandleVelocityCurve}","${currentstroke.driveHandlePowerCurve}"\n`
i++
}
try {
await fs.mkdir(directory, { recursive: true })
} catch (error) {
if (error.code !== 'EEXIST') {
log.error(`can not create directory ${directory}`, error)
}
}
await createFile(RowingData, `${filename}`, false)
}
@ -270,7 +278,7 @@ function createWorkoutRecorder () {
}
async function createRecordings () {
if (!config.createRawDataFiles && !config.createTcxFiles) {
if (!config.createRawDataFiles && !config.createTcxFiles && !config.createRowingDataFiles) {
return
}
@ -279,6 +287,8 @@ function createWorkoutRecorder () {
return
}
postExerciseHR = []
const parallelCalls = []
if (config.createRawDataFiles) {