From c6740423198c6d845b356f270e84fd9f828ddd81 Mon Sep 17 00:00:00 2001 From: mikiher Date: Tue, 7 May 2024 18:19:55 +0300 Subject: [PATCH] Add libraryItemIds to collapsedSeries objects --- server/utils/queries/libraryItemsBookFilters.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/utils/queries/libraryItemsBookFilters.js b/server/utils/queries/libraryItemsBookFilters.js index a728aaf5..35eb2de2 100644 --- a/server/utils/queries/libraryItemsBookFilters.js +++ b/server/utils/queries/libraryItemsBookFilters.js @@ -314,7 +314,8 @@ module.exports = { booksToInclude.push(book.id) bookSeriesToInclude.push({ id: book.bookSeries.id, - numBooks: s.dataValues.numBooks + numBooks: s.dataValues.numBooks, + libraryItemIds: s.books?.map((b) => b.libraryItem.id) || [] }) booksToExclude = booksToExclude.filter((bid) => bid !== book.id) found = true @@ -594,7 +595,8 @@ module.exports = { name: collapsedSeries.series.name, nameIgnorePrefix: collapsedSeries.series.nameIgnorePrefix, sequence: collapsedSeries.sequence, - numBooks: collapseSeriesObj?.numBooks || 0 + numBooks: collapseSeriesObj?.numBooks || 0, + libraryItemIds: collapseSeriesObj?.libraryItemIds || [] } } }