mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 02:05:06 +02:00
Change: Multiple authors are treated separately for filtering and searching #103
This commit is contained in:
parent
d38d4dcd62
commit
2c6cfae6a1
5 changed files with 39 additions and 15 deletions
|
@ -59,7 +59,7 @@ export const getters = {
|
|||
if (filter === 'No Series') filtered = filtered.filter(ab => ab.book && !ab.book.series)
|
||||
else filtered = filtered.filter(ab => ab.book && ab.book.series === filter)
|
||||
}
|
||||
else if (group === 'authors') filtered = filtered.filter(ab => ab.book && ab.book.authorFL === filter)
|
||||
else if (group === 'authors') filtered = filtered.filter(ab => ab.book && ab.book.authorFL && ab.book.authorFL.split(', ').includes(filter))
|
||||
else if (group === 'narrators') filtered = filtered.filter(ab => ab.book && ab.book.narrator === filter)
|
||||
else if (group === 'progress') {
|
||||
filtered = filtered.filter(ab => {
|
||||
|
@ -132,8 +132,13 @@ export const getters = {
|
|||
return seriesArray
|
||||
},
|
||||
getUniqueAuthors: (state) => {
|
||||
var _authors = state.audiobooks.filter(ab => !!(ab.book && ab.book.authorFL)).map(ab => ab.book.authorFL)
|
||||
return [...new Set(_authors)].sort((a, b) => a.toLowerCase() < b.toLowerCase() ? -1 : 1)
|
||||
var abAuthors = []
|
||||
state.audiobooks.forEach((ab) => {
|
||||
if (ab.book && ab.book.authorFL) {
|
||||
abAuthors = abAuthors.concat(ab.book.authorFL.split(', '))
|
||||
}
|
||||
})
|
||||
return [...new Set(abAuthors)].sort((a, b) => a.toLowerCase() < b.toLowerCase() ? -1 : 1)
|
||||
},
|
||||
getUniqueNarrators: (state) => {
|
||||
var _narrators = state.audiobooks.filter(ab => !!(ab.book && ab.book.narrator)).map(ab => ab.book.narrator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue