mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-09 12:12:43 +02:00
Change: Multiple authors are treated separately for filtering and searching #103
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user