Add:Chapter editor lookup chapters and apply titles only #991

This commit is contained in:
advplyr 2022-09-29 18:06:13 -05:00
parent 3a7639f690
commit 1a4833f873

View File

@ -142,8 +142,11 @@
<p class="pl-2">Chapter start is after the end of your audiobook</p> <p class="pl-2">Chapter start is after the end of your audiobook</p>
</div> </div>
</div> </div>
<div class="flex pt-2"> <div class="flex items-center pt-2">
<ui-btn small color="primary" @click="applyChapterNamesOnly">Apply Names Only</ui-btn> <ui-btn small color="primary" class="mr-1" @click="applyChapterNamesOnly">Map Chapter Titles</ui-btn>
<ui-tooltip text="Map chapter titles to your existing audiobook chapters without adjusting timestamps" direction="top">
<span class="material-icons-outlined">info</span>
</ui-tooltip>
<div class="flex-grow" /> <div class="flex-grow" />
<ui-btn small color="success" @click="applyChapterData">Apply Chapters</ui-btn> <ui-btn small color="success" @click="applyChapterData">Apply Chapters</ui-btn>
</div> </div>
@ -389,7 +392,16 @@ export default {
this.$toast.error('Failed to update chapters') this.$toast.error('Failed to update chapters')
}) })
}, },
applyChapterNamesOnly() {}, applyChapterNamesOnly() {
this.newChapters.forEach((chapter, index) => {
if (this.chapterData.chapters[index]) {
chapter.title = this.chapterData.chapters[index].title
}
})
this.showFindChaptersModal = false
this.chapterData = null
},
applyChapterData() { applyChapterData() {
var index = 0 var index = 0
this.newChapters = this.chapterData.chapters this.newChapters = this.chapterData.chapters