mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-02 01:05:25 +02:00
Fix decade filter and query by casting publishedYear to Int
This commit is contained in:
parent
217038b085
commit
d2c405c126
3 changed files with 9 additions and 10 deletions
|
@ -309,9 +309,9 @@ export const mutations = {
|
|||
}
|
||||
|
||||
// Add publishedDecades
|
||||
if (mediaMetadata.publishedYear) {
|
||||
if (mediaMetadata.publishedYear && !isNaN(mediaMetadata.publishedYear)) {
|
||||
const publishedYear = parseInt(mediaMetadata.publishedYear, 10)
|
||||
const decade = Math.floor(publishedYear / 10) * 10
|
||||
const decade = (Math.floor(publishedYear / 10) * 10).toString()
|
||||
if (!state.filterData.publishedDecades.includes(decade)) {
|
||||
state.filterData.publishedDecades.push(decade)
|
||||
state.filterData.publishedDecades.sort((a, b) => a - b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue