mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-06 09:21:37 +00:00
Improve consolidate behavior: redirect to book page and prevent library page redirects for same-library moves
This commit is contained in:
parent
3e752003e1
commit
5f599a9980
3 changed files with 13 additions and 5 deletions
|
|
@ -275,6 +275,9 @@ export default {
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.$toast.success(this.$strings.ToastBatchConsolidateSuccess)
|
this.$toast.success(this.$strings.ToastBatchConsolidateSuccess)
|
||||||
|
if (this.numMediaItemsSelected === 1) {
|
||||||
|
this.$router.push(`/item/${this.selectedMediaItems[0].id}`)
|
||||||
|
}
|
||||||
this.cancelSelectionMode()
|
this.cancelSelectionMode()
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
||||||
|
|
@ -816,6 +816,7 @@ export default {
|
||||||
.$post(`/api/items/${this.libraryItemId}/consolidate`)
|
.$post(`/api/items/${this.libraryItemId}/consolidate`)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$toast.success(this.$strings.ToastConsolidateSuccess || 'Consolidate successful')
|
this.$toast.success(this.$strings.ToastConsolidateSuccess || 'Consolidate successful')
|
||||||
|
this.$router.push(`/item/${this.libraryItemId}`)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Failed to consolidate', error)
|
console.error('Failed to consolidate', error)
|
||||||
|
|
|
||||||
|
|
@ -249,11 +249,15 @@ async function handleMoveLibraryItem(libraryItem, targetLibrary, targetFolder, n
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit socket events for UI updates
|
// Emit socket events for UI updates
|
||||||
SocketAuthority.emitter('item_removed', {
|
if (oldLibraryId !== targetLibrary.id) {
|
||||||
id: libraryItem.id,
|
SocketAuthority.emitter('item_removed', {
|
||||||
libraryId: oldLibraryId
|
id: libraryItem.id,
|
||||||
})
|
libraryId: oldLibraryId
|
||||||
SocketAuthority.libraryItemEmitter('item_added', libraryItem)
|
})
|
||||||
|
SocketAuthority.libraryItemEmitter('item_added', libraryItem)
|
||||||
|
} else {
|
||||||
|
SocketAuthority.libraryItemEmitter('item_updated', libraryItem)
|
||||||
|
}
|
||||||
|
|
||||||
Logger.info(`[LibraryItemController] Successfully moved item "${libraryItem.media.title}" to library "${targetLibrary.name}"`)
|
Logger.info(`[LibraryItemController] Successfully moved item "${libraryItem.media.title}" to library "${targetLibrary.name}"`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue