diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index f2a949ee0..0d2e6bad0 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -275,6 +275,9 @@ export default { }) .then((data) => { this.$toast.success(this.$strings.ToastBatchConsolidateSuccess) + if (this.numMediaItemsSelected === 1) { + this.$router.push(`/item/${this.selectedMediaItems[0].id}`) + } this.cancelSelectionMode() }) .catch((error) => { diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index d54bc6e3e..1703833d2 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -816,6 +816,7 @@ export default { .$post(`/api/items/${this.libraryItemId}/consolidate`) .then(() => { this.$toast.success(this.$strings.ToastConsolidateSuccess || 'Consolidate successful') + this.$router.push(`/item/${this.libraryItemId}`) }) .catch((error) => { console.error('Failed to consolidate', error) diff --git a/server/controllers/LibraryItemController.js b/server/controllers/LibraryItemController.js index c1ae5c5eb..aa581f2b5 100644 --- a/server/controllers/LibraryItemController.js +++ b/server/controllers/LibraryItemController.js @@ -249,11 +249,15 @@ async function handleMoveLibraryItem(libraryItem, targetLibrary, targetFolder, n } // Emit socket events for UI updates - SocketAuthority.emitter('item_removed', { - id: libraryItem.id, - libraryId: oldLibraryId - }) - SocketAuthority.libraryItemEmitter('item_added', libraryItem) + if (oldLibraryId !== targetLibrary.id) { + SocketAuthority.emitter('item_removed', { + id: libraryItem.id, + libraryId: oldLibraryId + }) + SocketAuthority.libraryItemEmitter('item_added', libraryItem) + } else { + SocketAuthority.libraryItemEmitter('item_updated', libraryItem) + } Logger.info(`[LibraryItemController] Successfully moved item "${libraryItem.media.title}" to library "${targetLibrary.name}"`) } catch (error) {