Improve consolidate behavior: redirect to book page and prevent library page redirects for same-library moves

This commit is contained in:
Tiberiu Ichim 2026-02-14 22:03:02 +02:00
parent 3e752003e1
commit 5f599a9980
3 changed files with 13 additions and 5 deletions

View file

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