+
{{ $strings.MessageBulkChapterPattern }}
{{ $strings.LabelDetectedPattern }} "{{ detectedPattern.before }}{{ formatNumberWithPadding(detectedPattern.startingNumber, detectedPattern) }}{{ detectedPattern.after }}"
@@ -272,13 +272,15 @@
{{ $strings.LabelNextChapters }}
"{{ detectedPattern.before }}{{ formatNumberWithPadding(detectedPattern.startingNumber + 1, detectedPattern) }}{{ detectedPattern.after }}", "{{ detectedPattern.before }}{{ formatNumberWithPadding(detectedPattern.startingNumber + 2, detectedPattern) }}{{ detectedPattern.after }}", etc.
-
-
-
+
+
+
+
-
-
{{ $strings.ButtonAddChapters }}
+
{{ $strings.ButtonCancel }}
+
+
{{ $strings.ButtonAddChapters }}
@@ -414,7 +416,7 @@ export default {
currentStartTime += track.duration
}
this.newChapters = chapters
-
+ this.lockedChapters = new Set()
this.checkChapters()
},
toggleRemoveBranding() {
@@ -707,7 +709,7 @@ export default {
},
applyChapterNamesOnly() {
this.newChapters.forEach((chapter, index) => {
- if (this.chapterData.chapters[index]) {
+ if (this.chapterData.chapters[index] && !this.lockedChapters.has(chapter.id)) {
chapter.title = this.chapterData.chapters[index].title
}
})
@@ -719,7 +721,7 @@ export default {
},
applyChapterData() {
let index = 0
- this.newChapters = this.chapterData.chapters
+ const audibleChapters = this.chapterData.chapters
.filter((chap) => chap.startOffsetSec < this.mediaDuration)
.map((chap) => {
return {
@@ -729,6 +731,21 @@ export default {
title: chap.title
}
})
+
+ const merged = []
+ let audibleIdx = 0
+ for (let i = 0; i < Math.max(this.newChapters.length, audibleChapters.length); i++) {
+ const isLocked = this.lockedChapters.has(i)
+ if (isLocked && this.newChapters[i]) {
+ merged.push({ ...this.newChapters[i], id: i })
+ } else if (audibleChapters[audibleIdx]) {
+ merged.push({ ...audibleChapters[audibleIdx], id: i })
+ audibleIdx++
+ } else if (this.newChapters[i]) {
+ merged.push({ ...this.newChapters[i], id: i })
+ }
+ }
+ this.newChapters = merged
this.showFindChaptersModal = false
this.chapterData = null
@@ -827,6 +844,7 @@ export default {
}
]
}
+ this.lockedChapters = new Set()
this.checkChapters()
},
removeAllChaptersClick() {