mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-25 13:14:33 +02:00
Finish lazy bookshelf,Fix:Async sql db,Fix:Load user progress
This commit is contained in:
parent
37d3021302
commit
3232b519d3
42 changed files with 613 additions and 1878 deletions
|
@ -136,4 +136,45 @@ export const mutations = {
|
|||
setLibraryFilterData(state, filterData) {
|
||||
state.filterData = filterData
|
||||
},
|
||||
updateFilterDataWithAudiobook(state, audiobook) {
|
||||
if (!audiobook || !audiobook.book || !state.filterData) return
|
||||
if (state.currentLibraryId !== audiobook.libraryId) return
|
||||
/*
|
||||
var filterdata = {
|
||||
authors: [],
|
||||
genres: [],
|
||||
tags: [],
|
||||
series: [],
|
||||
narrators: []
|
||||
}
|
||||
*/
|
||||
|
||||
if (audiobook.book.authorFL) {
|
||||
audiobook.book.authorFL.split(', ').forEach((author) => {
|
||||
if (author && !state.filterData.authors.includes(author)) {
|
||||
state.filterData.authors.push(author)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (audiobook.book.narratorFL) {
|
||||
audiobook.book.narratorFL.split(', ').forEach((narrator) => {
|
||||
if (narrator && !state.filterData.narrators.includes(narrator)) {
|
||||
state.filterData.narrators.push(narrator)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (audiobook.book.series && !state.filterData.series.includes(audiobook.book.series)) {
|
||||
state.filterData.series.push(audiobook.book.series)
|
||||
}
|
||||
if (audiobook.tags && audiobook.tags.length) {
|
||||
audiobook.tags.forEach((tag) => {
|
||||
if (tag && !state.filterData.tags.includes(tag)) state.filterData.tags.push(tag)
|
||||
})
|
||||
}
|
||||
if (audiobook.book.genres && audiobook.book.genres.length) {
|
||||
audiobook.book.genres.forEach((genre) => {
|
||||
if (genre && !state.filterData.genres.includes(genre)) state.filterData.genres.push(genre)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue