mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-04 22:16:28 +01:00
Update get series endpoint to return a 404 when the series has no accessible books
This commit is contained in:
1 parent
f5a40b1ece
commit
625b854236
1 file changed
+4
@@ -787,6 +787,10 @@ class LibraryController {
|
||||
if (!series || series.libraryId !== req.library.id) return res.sendStatus(404)
|
||||
|
||||
const libraryItemsInSeries = await libraryItemsBookFilters.getLibraryItemsForSeries(series, req.user)
|
||||
if (!libraryItemsInSeries.length) {
|
||||
Logger.warn(`[LibraryController] User "${req.user.username}" attempted to access series "${series.id}" with no accessible books`)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
const seriesJson = series.toOldJSON()
|
||||
if (include.includes('progress')) {
|
||||
|
||||
Reference in new issue
Block a user