mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 02:22:09 +01:00
Update collection API routes to load libraryItems from DB
This commit is contained in:
@@ -882,24 +882,25 @@ module.exports = {
|
||||
Logger.error(`[libraryItemsBookFilters] Invalid collection`, collection)
|
||||
return []
|
||||
}
|
||||
|
||||
const books = await Database.models.book.findAll({
|
||||
where: {
|
||||
id: {
|
||||
[Sequelize.Op.in]: collection.books
|
||||
}
|
||||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.models.libraryItem
|
||||
model: Database.models.libraryItem,
|
||||
where: {
|
||||
id: {
|
||||
[Sequelize.Op.in]: collection.books
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
model: sequelize.models.author,
|
||||
model: Database.models.author,
|
||||
through: {
|
||||
attributes: []
|
||||
}
|
||||
},
|
||||
{
|
||||
model: sequelize.models.series,
|
||||
model: Database.models.series,
|
||||
through: {
|
||||
attributes: ['sequence']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user