From dc038357426b0b80987364fc3e51140dd8df0b3a Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 15 Dec 2022 17:40:34 -0600 Subject: [PATCH] Update:Trim whitespace from chapter titles in chapter editor #1248 --- client/pages/audiobook/_id/chapters.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/pages/audiobook/_id/chapters.vue b/client/pages/audiobook/_id/chapters.vue index a18e7e27..c596f088 100644 --- a/client/pages/audiobook/_id/chapters.vue +++ b/client/pages/audiobook/_id/chapters.vue @@ -354,6 +354,7 @@ export default { for (let i = 0; i < this.newChapters.length; i++) { this.newChapters[i].id = i this.newChapters[i].start = Number(this.newChapters[i].start) + this.newChapters[i].title = (this.newChapters[i].title || '').trim() if (i === 0 && this.newChapters[i].start !== 0) { this.newChapters[i].error = this.$strings.MessageChapterErrorFirstNotZero @@ -512,15 +513,14 @@ export default { this.checkChapters() }, applyChapterData() { - var index = 0 + let index = 0 this.newChapters = this.chapterData.chapters .filter((chap) => chap.startOffsetSec < this.mediaDuration) .map((chap) => { - var chapEnd = Math.min(this.mediaDuration, (chap.startOffsetMs + chap.lengthMs) / 1000) return { id: index++, start: chap.startOffsetMs / 1000, - end: chapEnd, + end: Math.min(this.mediaDuration, (chap.startOffsetMs + chap.lengthMs) / 1000), title: chap.title } })