mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 11:21:36 +00:00
Add publishedDecades filter group to MediaGroupQuery
This commit is contained in:
parent
cf32ca25f0
commit
a3557de8ea
1 changed files with 5 additions and 0 deletions
|
|
@ -228,6 +228,11 @@ module.exports = {
|
|||
} else if (value === 'series') {
|
||||
mediaWhere['$series.id$'] = null
|
||||
}
|
||||
} else if (group === 'publishedDecades') {
|
||||
const year = parseInt(value, 10);
|
||||
mediaWhere['publishedYear'] = {
|
||||
[Sequelize.Op.between]: year >= 1000 ? [year, year + 9] : [year * 10, (year + 1) * 10 - 1]
|
||||
}
|
||||
}
|
||||
|
||||
return { mediaWhere, replacements }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue