mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 06:59:41 +00:00
Add consolidate feature
This commit is contained in:
parent
56eca37304
commit
96707200b8
8 changed files with 294 additions and 13 deletions
|
|
@ -565,6 +565,12 @@ export default {
|
|||
func: 'showEditModalMatch',
|
||||
text: this.$strings.HeaderMatch
|
||||
})
|
||||
if (!this.isFile && !this.isPodcast) {
|
||||
items.push({
|
||||
func: 'consolidate',
|
||||
text: 'Consolidate'
|
||||
})
|
||||
}
|
||||
}
|
||||
if ((this.userIsAdminOrUp || this.userCanDelete) && !this.isFile) {
|
||||
items.push({
|
||||
|
|
@ -799,6 +805,31 @@ export default {
|
|||
// More menu func
|
||||
this.$emit('edit', this.libraryItem, 'match')
|
||||
},
|
||||
consolidate() {
|
||||
const payload = {
|
||||
message: this.$getString('MessageConfirmConsolidate', [this.title, `${this.author} - ${this.title}`]),
|
||||
callback: (confirmed) => {
|
||||
if (confirmed) {
|
||||
this.processing = true
|
||||
const axios = this.$axios || this.$nuxt.$axios
|
||||
axios
|
||||
.$post(`/api/items/${this.libraryItemId}/consolidate`)
|
||||
.then(() => {
|
||||
this.$toast.success(this.$strings.ToastConsolidateSuccess || 'Consolidate successful')
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to consolidate', error)
|
||||
this.$toast.error(error.response?.data || this.$strings.ToastConsolidateFailed || 'Consolidate failed')
|
||||
})
|
||||
.finally(() => {
|
||||
this.processing = false
|
||||
})
|
||||
}
|
||||
},
|
||||
type: 'yesNo'
|
||||
}
|
||||
this.store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
sendToDevice(deviceName) {
|
||||
// More menu func
|
||||
const payload = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue