mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-03 14:39:41 +00:00
feat: add library-wide consolidation status update tool and improve consolidation robustness
This commit is contained in:
parent
2c77f1fc5a
commit
c2693e2460
8 changed files with 118 additions and 11 deletions
|
|
@ -37,6 +37,18 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isBookLibrary" class="w-full border border-black-200 p-4 my-8">
|
||||
<div class="flex flex-wrap items-center">
|
||||
<div>
|
||||
<p class="text-lg">{{ $strings.LabelUpdateConsolidationStatus }}</p>
|
||||
<p class="max-w-sm text-sm pt-2 text-gray-300">{{ $strings.LabelUpdateConsolidationStatusHelp }}</p>
|
||||
</div>
|
||||
<div class="grow" />
|
||||
<div>
|
||||
<ui-btn @click.stop="updateConsolidationStatusClick">{{ $strings.ButtonUpdate }}</ui-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -158,6 +170,34 @@ export default {
|
|||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
},
|
||||
updateConsolidationStatusClick() {
|
||||
const payload = {
|
||||
message: this.$strings.MessageConfirmUpdateConsolidationStatus,
|
||||
persistent: true,
|
||||
callback: (confirmed) => {
|
||||
if (confirmed) {
|
||||
this.updateConsolidationStatus()
|
||||
}
|
||||
},
|
||||
type: 'yesNo'
|
||||
}
|
||||
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
updateConsolidationStatus() {
|
||||
this.$emit('update:processing', true)
|
||||
this.$axios
|
||||
.$post(`/api/libraries/${this.libraryId}/update-consolidation`)
|
||||
.then((data) => {
|
||||
this.$toast.success(this.$getString('ToastUpdateConsolidationStatusSuccess', [data.updated]))
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to update consolidation status', error)
|
||||
this.$toast.error(this.$strings.ToastUpdateConsolidationStatusFailed)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue