Fix:Home page recent series shelf respect hide single book series library setting #2134

This commit is contained in:
advplyr 2023-09-30 14:32:40 -05:00
parent 8d3a326216
commit 1dc369180c

View File

@ -205,6 +205,15 @@ module.exports = {
} }
} }
] ]
// Handle library setting to hide single book series
// TODO: Merge with existing query
if (library.settings.hideSingleBookSeries) {
seriesWhere.push(Sequelize.where(Sequelize.literal(`(SELECT count(*) FROM books b, bookSeries bs WHERE bs.seriesId = series.id AND bs.bookId = b.id)`), {
[Sequelize.Op.gt]: 1
}))
}
// Handle user permissions to only include series with at least 1 book // Handle user permissions to only include series with at least 1 book
// TODO: Simplify to a single query // TODO: Simplify to a single query
if (userPermissionBookWhere.bookWhere.length) { if (userPermissionBookWhere.bookWhere.length) {