Fix socket events check user permissions for library items #4199

This commit is contained in:
advplyr 2025-04-12 17:39:51 -05:00
parent 26309019e7
commit bc1b99efd6
10 changed files with 69 additions and 61 deletions

View file

@ -152,10 +152,7 @@ class AuthorController {
for (const libraryItem of libraryItems) {
await libraryItem.saveMetadataFile()
}
SocketAuthority.emitter(
'items_updated',
libraryItems.map((li) => li.toOldJSONExpanded())
)
SocketAuthority.libraryItemsEmitter('items_updated', libraryItems)
}
// Remove old author
@ -210,10 +207,7 @@ class AuthorController {
}
if (libraryItems.length) {
SocketAuthority.emitter(
'items_updated',
libraryItems.map((li) => li.toOldJSONExpanded())
)
SocketAuthority.libraryItemsEmitter('items_updated', libraryItems)
}
} else {
numBooksForAuthor = await Database.bookAuthorModel.getCountForAuthor(req.author.id)