Fix library consolidation filter and implement podcast support

This commit is contained in:
Tiberiu Ichim 2026-02-15 15:46:46 +02:00
parent b3cdd880e1
commit 23034e6672
12 changed files with 153 additions and 14 deletions

View file

@ -27,7 +27,7 @@ module.exports = {
let filterValue = null
let filterGroup = null
if (filterBy) {
const searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'publishers', 'publishedDecades', 'missing', 'languages', 'tracks', 'ebooks']
const searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'publishers', 'publishedDecades', 'missing', 'languages', 'tracks', 'ebooks', 'consolidated']
const group = searchGroups.find((_group) => filterBy.startsWith(_group + '.'))
filterGroup = group || filterBy
filterValue = group ? this.decode(filterBy.replace(`${group}.`, '')) : null

View file

@ -239,6 +239,8 @@ module.exports = {
mediaWhere = Sequelize.where(Sequelize.literal('CAST(publishedYear AS INTEGER)'), {
[Sequelize.Op.between]: [startYear, endYear]
})
} else if (group === 'consolidated') {
// This is handled in libraryItemWhere in getFilteredLibraryItems
}
return { mediaWhere, replacements }
@ -531,6 +533,8 @@ module.exports = {
libraryItemWhere['createdAt'] = {
[Sequelize.Op.gte]: new Date(new Date() - 60 * 24 * 60 * 60 * 1000) // 60 days ago
}
} else if (filterGroup === 'consolidated') {
libraryItemWhere['isNotConsolidated'] = filterValue === 'not-consolidated'
}
// When sorting by progress but not filtering by progress, include media progresses

View file

@ -172,6 +172,8 @@ module.exports = {
libraryItemWhere['createdAt'] = {
[Sequelize.Op.gte]: new Date(new Date() - 60 * 24 * 60 * 60 * 1000) // 60 days ago
}
} else if (filterGroup === 'consolidated') {
libraryItemWhere['isNotConsolidated'] = filterValue === 'not-consolidated'
}
const podcastIncludes = []