Fixing scanner inodes, select all fix, starting ebook reader

This commit is contained in:
advplyr 2021-09-27 06:52:21 -05:00
parent 29ba62357d
commit 26b37def46
21 changed files with 661 additions and 66 deletions

View file

@ -10,13 +10,32 @@ export const state = () => ({
genres: [...STANDARD_GENRES],
tags: [],
series: [],
keywordFilter: null
keywordFilter: null,
selectedSeries: null,
libraryPage: null,
searchResults: []
})
export const getters = {
getAudiobook: (state) => id => {
return state.audiobooks.find(ab => ab.id === id)
},
getEntitiesShowing: (state, getters, rootState, rootGetters) => () => {
if (!state.libraryPage) {
return getters.getFiltered()
} else if (state.libraryPage === 'search') {
return state.searchResults
} else if (state.libraryPage === 'series') {
var series = getters.getSeriesGroups()
if (state.selectedSeries) {
var _series = series.find(__series => __series.name === state.selectedSeries)
if (!_series) return []
return _series.books || []
}
return series
}
return []
},
getFiltered: (state, getters, rootState, rootGetters) => () => {
var filtered = state.audiobooks
var settings = rootState.user.settings || {}
@ -159,6 +178,15 @@ export const mutations = {
setKeywordFilter(state, val) {
state.keywordFilter = val
},
setSelectedSeries(state, val) {
state.selectedSeries = val
},
setLibraryPage(state, val) {
state.libraryPage = val
},
setSearchResults(state, val) {
state.searchResults = val
},
set(state, audiobooks) {
// GENRES
var genres = [...state.genres]