Misnamed variable and cumulative length

This commit is contained in:
Nicholas Wallace 2024-06-15 01:20:22 +00:00
parent 34b340f179
commit cadef9b023

View File

@ -115,12 +115,12 @@ function generateParsedChapters(includedAudioFiles, cleanedOverdriveMediaMarkers
cleanedOverdriveMediaMarkers[track_index].forEach((chapter) => { cleanedOverdriveMediaMarkers[track_index].forEach((chapter) => {
let timeParts = chapter.Time.split(':') let timeParts = chapter.Time.split(':')
// add seconds // add seconds
time = parseFloat(timeParts.pop()) time = length + parseFloat(timeParts.pop())
if (parts.length) { if (timeParts.length) {
// add minutes // add minutes
time += parseFloat(timeParts.pop()) * 60 time += parseFloat(timeParts.pop()) * 60
} }
if (parts.length) { if (timeParts.length) {
// add hours // add hours
time += parseFloat(timeParts.pop()) * 3600 time += parseFloat(timeParts.pop()) * 3600
} }