mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix and simplify filter logic for publishedDecades
This commit is contained in:
parent
13dd4edd6a
commit
217038b085
@ -229,9 +229,10 @@ module.exports = {
|
||||
mediaWhere['$series.id$'] = null
|
||||
}
|
||||
} else if (group === 'publishedDecades') {
|
||||
const year = parseInt(value, 10)
|
||||
const startYear = value.padStart(4, '0')
|
||||
const endYear = (parseInt(value, 10) + 9).toString().padStart(4, '0')
|
||||
mediaWhere['publishedYear'] = {
|
||||
[Sequelize.Op.between]: year >= 1000 ? [year, year + 9] : [year * 10, (year + 1) * 10 - 1]
|
||||
[Sequelize.Op.between]: [startYear, endYear]
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user