Add consolidate feature

This commit is contained in:
Tiberiu Ichim 2026-02-13 14:15:18 +02:00
parent 56eca37304
commit 96707200b8
8 changed files with 294 additions and 13 deletions

View file

@ -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 = {