mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 11:21:36 +00:00
Add publishedDecades to libraries store
This commit is contained in:
parent
af91b413d0
commit
8c19a35f5d
1 changed files with 12 additions and 1 deletions
|
|
@ -240,7 +240,8 @@ export const mutations = {
|
|||
series: [],
|
||||
narrators: [],
|
||||
languages: [],
|
||||
publishers: []
|
||||
publishers: [],
|
||||
publishedDecades: []
|
||||
}
|
||||
*/
|
||||
const mediaMetadata = libraryItem.media.metadata
|
||||
|
|
@ -307,6 +308,16 @@ export const mutations = {
|
|||
state.filterData.publishers.sort((a, b) => a.localeCompare(b))
|
||||
}
|
||||
|
||||
// Add publishedDecades
|
||||
if (mediaMetadata.publishedYear) {
|
||||
const publishedYear = parseInt(mediaMetadata.publishedYear, 10);
|
||||
const decade = Math.floor(publishedYear / 10) * 10
|
||||
if (!state.filterData.publishedDecades.includes(decade)) {
|
||||
state.filterData.publishedDecades.push(decade)
|
||||
state.filterData.publishedDecades.sort((a, b) => a - b)
|
||||
}
|
||||
}
|
||||
|
||||
// Add language
|
||||
if (mediaMetadata.language && !state.filterData.languages.includes(mediaMetadata.language)) {
|
||||
state.filterData.languages.push(mediaMetadata.language)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue