mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-13 21:01:39 +00:00
Apply minified serialization to books inside collections
The GET /api/libraries/:id/collections endpoint captured the minified flag on the response payload but never passed it down to the book serialization, so each book was always returned fully expanded with its complete libraryFiles array and heavy media fields (audioFiles, chapters, tracks). For libraries with multi-file audiobooks this produced responses of tens of megabytes even when minified=1 was requested. Thread the minified flag through getOldCollectionsJsonExpanded and Collection.toOldJSONExpanded so that, when requested, books use the existing library item minified form. Non-minified requests are unchanged. Fixes #5170
This commit is contained in:
parent
6f03467f35
commit
42c6798981
3 changed files with 117 additions and 5 deletions
|
|
@ -830,7 +830,7 @@ class LibraryController {
|
|||
}
|
||||
|
||||
// TODO: Create paginated queries
|
||||
let collections = await Database.collectionModel.getOldCollectionsJsonExpanded(req.user, req.library.id, include)
|
||||
let collections = await Database.collectionModel.getOldCollectionsJsonExpanded(req.user, req.library.id, include, payload.minified)
|
||||
|
||||
payload.total = collections.length
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue