Update chapter toast strings, update spacing, autoformat

This commit is contained in:
advplyr 2025-05-10 16:42:34 -05:00
parent 26c976b6b9
commit 0df5a7816d
2 changed files with 10 additions and 11 deletions

View File

@ -144,11 +144,11 @@
<div v-if="!chapterData" class="flex flex-col items-center justify-center p-20"> <div v-if="!chapterData" class="flex flex-col items-center justify-center p-20">
<div class="relative"> <div class="relative">
<div class="flex items-end space-x-2"> <div class="flex items-end space-x-2">
<ui-text-input-with-label v-model.trim="asinInput" label="ASIN" class="flex-3"/> <ui-text-input-with-label v-model.trim="asinInput" label="ASIN" class="flex-grow" />
<ui-dropdown v-model="regionInput" :label="$strings.LabelRegion" small :items="audibleRegions" class="w-32 flex-2" /> <ui-dropdown v-model="regionInput" :label="$strings.LabelRegion" small :items="audibleRegions" class="w-20 max-w-20" />
<ui-btn color="bg-primary flex-1" @click="findChapters">{{ $strings.ButtonSearch }}</ui-btn> <ui-btn color="bg-primary" @click="findChapters">{{ $strings.ButtonSearch }}</ui-btn>
</div> </div>
<div class="mt-2"> <div class="mt-4">
<ui-checkbox v-model="removeBranding" :label="$strings.LabelRemoveAudibleBranding" small checkbox-bg="bg" label-class="pl-2 text-base text-sm" @click="toggleRemoveBranding" /> <ui-checkbox v-model="removeBranding" :label="$strings.LabelRemoveAudibleBranding" small checkbox-bg="bg" label-class="pl-2 text-base text-sm" @click="toggleRemoveBranding" />
</div> </div>
<div class="absolute left-0 mt-1.5 text-error text-s h-5"> <div class="absolute left-0 mt-1.5 text-error text-s h-5">
@ -157,7 +157,6 @@
</div> </div>
<div class="invisible mt-1 text-xs"></div> <div class="invisible mt-1 text-xs"></div>
</div> </div>
</div> </div>
<div v-else class="w-full p-4"> <div v-else class="w-full p-4">
<div class="flex justify-between mb-4"> <div class="flex justify-between mb-4">
@ -326,7 +325,7 @@ export default {
this.checkChapters() this.checkChapters()
}, },
toggleRemoveBranding() { toggleRemoveBranding() {
this.removeBranding = !this.removeBranding; this.removeBranding = !this.removeBranding
}, },
shiftChapterTimes() { shiftChapterTimes() {
if (!this.shiftAmount || isNaN(this.shiftAmount) || this.newChapters.length <= 1) { if (!this.shiftAmount || isNaN(this.shiftAmount) || this.newChapters.length <= 1) {
@ -337,12 +336,12 @@ export default {
const lastChapter = this.newChapters[this.newChapters.length - 1] const lastChapter = this.newChapters[this.newChapters.length - 1]
if (lastChapter.start + amount > this.mediaDurationRounded) { if (lastChapter.start + amount > this.mediaDurationRounded) {
this.$toast.error(this.$strings.ToastInvalidShiftAmountLast) this.$toast.error(this.$strings.ToastChaptersInvalidShiftAmountLast)
return return
} }
if (this.newChapters[1].start + amount <= 0) { if (this.newChapters[1].start + amount <= 0) {
this.$toast.error(this.$strings.ToastInvalidShiftAmountStart) this.$toast.error(this.$strings.ToastChaptersInvalidShiftAmountStart)
return return
} }
@ -610,10 +609,10 @@ export default {
data.chapters.pop() data.chapters.pop()
} }
return data
} catch { } catch {
return data return data
} }
return data
}, },
resetChapters() { resetChapters() {
const payload = { const payload = {

View File

@ -973,6 +973,8 @@
"ToastCachePurgeFailed": "Failed to purge cache", "ToastCachePurgeFailed": "Failed to purge cache",
"ToastCachePurgeSuccess": "Cache purged successfully", "ToastCachePurgeSuccess": "Cache purged successfully",
"ToastChaptersHaveErrors": "Chapters have errors", "ToastChaptersHaveErrors": "Chapters have errors",
"ToastChaptersInvalidShiftAmountLast": "Invalid shift amount. The last chapter start time would extend beyond the duration of this audiobook.",
"ToastChaptersInvalidShiftAmountStart": "Invalid shift amount. The first chapter would have zero or negative length and would be overwritten by the second chapter. Increase the start duration of second chapter.",
"ToastChaptersMustHaveTitles": "Chapters must have titles", "ToastChaptersMustHaveTitles": "Chapters must have titles",
"ToastChaptersRemoved": "Chapters removed", "ToastChaptersRemoved": "Chapters removed",
"ToastChaptersUpdated": "Chapters updated", "ToastChaptersUpdated": "Chapters updated",
@ -1000,8 +1002,6 @@
"ToastFailedToUpdate": "Failed to update", "ToastFailedToUpdate": "Failed to update",
"ToastInvalidImageUrl": "Invalid image URL", "ToastInvalidImageUrl": "Invalid image URL",
"ToastInvalidMaxEpisodesToDownload": "Invalid max episodes to download", "ToastInvalidMaxEpisodesToDownload": "Invalid max episodes to download",
"ToastInvalidShiftAmountLast": "Invalid shift amount. The last chapter start time would extend beyond the duration of this audiobook.",
"ToastInvalidShiftAmountStart": "Invalid shift amount. The first chapter would have zero or negative length and would be overwritten by the second chapter. Increase the start duration of second chapter.",
"ToastInvalidUrl": "Invalid URL", "ToastInvalidUrl": "Invalid URL",
"ToastItemCoverUpdateSuccess": "Item cover updated", "ToastItemCoverUpdateSuccess": "Item cover updated",
"ToastItemDeletedFailed": "Failed to delete item", "ToastItemDeletedFailed": "Failed to delete item",