mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
Fix library consolidation filter and implement podcast support
This commit is contained in:
parent
b3cdd880e1
commit
23034e6672
12 changed files with 153 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue