mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-19 17:29:48 +02:00
Fix:Batch API endpoints crash on reset library filter data
This commit is contained in:
parent
0ecfdab463
commit
4ad1cd2968
@ -322,6 +322,7 @@ class LibraryItemController {
|
|||||||
return res.sendStatus(404)
|
return res.sendStatus(404)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const libraryId = itemsToDelete[0].libraryId
|
||||||
for (const libraryItem of itemsToDelete) {
|
for (const libraryItem of itemsToDelete) {
|
||||||
const libraryItemPath = libraryItem.path
|
const libraryItemPath = libraryItem.path
|
||||||
Logger.info(`[LibraryItemController] Deleting Library Item "${libraryItem.media.metadata.title}"`)
|
Logger.info(`[LibraryItemController] Deleting Library Item "${libraryItem.media.metadata.title}"`)
|
||||||
@ -334,7 +335,7 @@ class LibraryItemController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await Database.resetLibraryIssuesFilterData(req.libraryItem.libraryId)
|
await Database.resetLibraryIssuesFilterData(libraryId)
|
||||||
res.sendStatus(200)
|
res.sendStatus(200)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,6 +453,7 @@ class LibraryItemController {
|
|||||||
|
|
||||||
res.sendStatus(200)
|
res.sendStatus(200)
|
||||||
|
|
||||||
|
const libraryId = libraryItems[0].libraryId
|
||||||
for (const libraryItem of libraryItems) {
|
for (const libraryItem of libraryItems) {
|
||||||
if (libraryItem.isFile) {
|
if (libraryItem.isFile) {
|
||||||
Logger.warn(`[LibraryItemController] Re-scanning file library items not yet supported`)
|
Logger.warn(`[LibraryItemController] Re-scanning file library items not yet supported`)
|
||||||
@ -460,7 +462,7 @@ class LibraryItemController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await Database.resetLibraryIssuesFilterData(req.libraryItem.libraryId)
|
await Database.resetLibraryIssuesFilterData(libraryId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST: api/items/:id/scan
|
// POST: api/items/:id/scan
|
||||||
|
Loading…
x
Reference in New Issue
Block a user