mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Update collection API routes to load libraryItems from DB
This commit is contained in:
parent
38029d1202
commit
db80cec168
8 changed files with 344 additions and 139 deletions
|
@ -393,14 +393,6 @@ class ApiRouter {
|
|||
// TODO: Remove open sessions for library item
|
||||
let mediaItemIds = []
|
||||
if (libraryItem.isBook) {
|
||||
// remove book from collections
|
||||
const collectionsWithBook = await Database.models.collection.getAllForBook(libraryItem.media.id)
|
||||
for (const collection of collectionsWithBook) {
|
||||
collection.removeBook(libraryItem.id)
|
||||
await Database.removeCollectionBook(collection.id, libraryItem.media.id)
|
||||
SocketAuthority.emitter('collection_updated', collection.toJSONExpanded(Database.libraryItems))
|
||||
}
|
||||
|
||||
// Check remove empty series
|
||||
await this.checkRemoveEmptySeries(libraryItem.media.metadata.series, libraryItem.id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue