mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 01:41:35 +00:00
fix: series book count with active filters
This commit is contained in:
parent
4502d37d4f
commit
c4e7172c2f
1 changed files with 2 additions and 2 deletions
|
|
@ -311,7 +311,7 @@ module.exports = {
|
|||
*/
|
||||
async getCollapseSeriesBooksToExclude(bookFindOptions, seriesWhere, replacements = {}) {
|
||||
const allSeries = await Database.seriesModel.findAll({
|
||||
attributes: ['id', 'name', [Sequelize.literal('(SELECT count(*) FROM bookSeries bs WHERE bs.seriesId = series.id)'), 'numBooks']],
|
||||
attributes: ['id', 'name'],
|
||||
distinct: true,
|
||||
subQuery: false,
|
||||
replacements,
|
||||
|
|
@ -339,7 +339,7 @@ module.exports = {
|
|||
booksToInclude.push(book.id)
|
||||
bookSeriesToInclude.push({
|
||||
id: book.bookSeries.id,
|
||||
numBooks: s.dataValues.numBooks,
|
||||
numBooks: s.books.length,
|
||||
libraryItemIds: s.books?.map((b) => b.libraryItem.id) || []
|
||||
})
|
||||
booksToExclude = booksToExclude.filter((bid) => bid !== book.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue