mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-18 13:52:02 +02:00
added library to be returned instead of libraryId and fixed stupid req.library asignment
This commit is contained in:
parent
858ea5010a
commit
3d906347c3
@ -44,12 +44,10 @@ class LibraryController {
|
||||
const allStats = [];
|
||||
|
||||
for (let i = 0; i < allLibrariesIds.length; i++) {
|
||||
req.library = {
|
||||
id: allLibrariesIds[i],
|
||||
mediaType: (await Database.libraryModel.getOldById(allLibrariesIds[i])).mediaType,
|
||||
};
|
||||
const library = await Database.libraryModel.getOldById(allLibrariesIds[i]);
|
||||
req.library = library
|
||||
const libraryStats = await libraryHelpers.getLibraryStats(req);
|
||||
allStats.push({ libraryId: req.library.id, stats: libraryStats });
|
||||
allStats.push({ library: library, stats: libraryStats });
|
||||
}
|
||||
|
||||
res.json(allStats);
|
||||
|
Loading…
Reference in New Issue
Block a user