Fetching...
Nothing found
{{ item.data.book.title }}
-{{ item.data.book.author }}
-Books
+ +Series
+ +Authors
+ +New
-{{ title }}
+ + +{{ matchHtml }}
+ +by {{ authorFL }}
+ + + +{{ title }}
+{{ titleCleaned }}
+{{ authorCleaned }}
+#{{ volumeNumber }}
+{{ title }}
+{{ title }}
+{{ series }}
+{{ title }}
+
+ Invalid Cover
+{{ titleCleaned }}
+{{ authorCleaned }}
+Empty Collection
+{{ name }}
+{{ numEntities }} {{ entityTitle }}
-{{ selectedSeriesName }}
- +{{ totalEntities }} {{ entityTitle }}
+{{ selectedSeriesName }} ({{ totalEntities }})
@@ -32,12 +31,13 @@ export default { showSortModal: false, showFilterModal: false, settings: {}, - isListView: false + isListView: false, + totalEntities: 0 } }, computed: { hasFilters() { - return this.$store.getters['user/getUserSetting']('filterBy') !== 'all' + return this.$store.getters['user/getUserSetting']('mobileFilterBy') !== 'all' }, page() { var routeName = this.$route.name || '' @@ -47,42 +47,17 @@ export default { return this.$route.query || {} }, entityTitle() { - if (this.page === 'library') return 'Audiobooks' + if (this.page === 'library') return 'Books' else if (this.page === 'series') { - if (this.selectedSeriesName) return 'Books in ' + this.selectedSeriesName return 'Series' } else if (this.page === 'collections') { return 'Collections' } return '' }, - numEntities() { - if (this.page === 'library') return this.numAudiobooks - else if (this.page === 'series') { - if (this.selectedSeriesName) return this.numBooksInSeries - return this.series.length - } else if (this.page === 'collections') return this.numCollections - return 0 - }, - series() { - return this.$store.getters['audiobooks/getSeriesGroups']() || [] - }, - numCollections() { - return (this.$store.state.user.collections || []).length - }, - numAudiobooks() { - return this.$store.getters['audiobooks/getFiltered']().length - }, - numBooksInSeries() { - return this.selectedSeries ? (this.selectedSeries.books || []).length : 0 - }, - selectedSeries() { - if (!this.selectedSeriesName) return null - return this.series.find((s) => s.name === this.selectedSeriesName) - }, selectedSeriesName() { - if (this.page === 'series' && this.routeQuery.series) { - return this.$decode(this.routeQuery.series) + if (this.page === 'series' && this.$route.params.id) { + return this.$decode(this.$route.params.id) } return null }, @@ -120,13 +95,18 @@ export default { for (const key in settings) { this.settings[key] = settings[key] } + }, + setTotalEntities(total) { + this.totalEntities = total } }, mounted() { this.init() + this.$eventBus.$on('bookshelf-total-entities', this.setTotalEntities) this.$store.commit('user/addSettingsListener', { id: 'bookshelftoolbar', meth: this.settingsUpdated }) }, beforeDestroy() { + this.$eventBus.$off('bookshelf-total-entities', this.setTotalEntities) this.$store.commit('user/removeSettingsListener', 'bookshelftoolbar') } } diff --git a/components/modals/FilterModal.vue b/components/modals/FilterModal.vue index 3049bc07..51787552 100644 --- a/components/modals/FilterModal.vue +++ b/components/modals/FilterModal.vue @@ -81,10 +81,20 @@ export default { value: 'authors', sublist: true }, + { + text: 'Narrator', + value: 'narrators', + sublist: true + }, { text: 'Progress', value: 'progress', sublist: true + }, + { + text: 'Issues', + value: 'issues', + sublist: false } ] } @@ -118,16 +128,19 @@ export default { return this.selected && this.selected.includes('.') ? this.selected.split('.')[0] : false }, genres() { - return this.$store.getters['audiobooks/getGenresUsed'] + return this.filterData.genres || [] }, tags() { - return this.$store.state.audiobooks.tags + return this.filterData.tags || [] }, series() { - return this.$store.state.audiobooks.series + return this.filterData.series || [] }, authors() { - return this.$store.getters['audiobooks/getUniqueAuthors'] + return this.filterData.authors || [] + }, + narrators() { + return this.filterData.narrators || [] }, progress() { return ['Read', 'Unread', 'In Progress'] @@ -139,6 +152,9 @@ export default { value: this.$encode(item) } }) + }, + filterData() { + return this.$store.state.libraries.filterData || {} } }, methods: { diff --git a/components/modals/LibrariesModal.vue b/components/modals/LibrariesModal.vue index 1d8c3206..ff783032 100644 --- a/components/modals/LibrariesModal.vue +++ b/components/modals/LibrariesModal.vue @@ -53,10 +53,8 @@ export default { methods: { async clickedOption(lib) { this.show = false - - this.$store.commit('libraries/setCurrentLibrary', lib.id) - await this.$store.dispatch('audiobooks/load') - + await this.$store.dispatch('libraries/fetch', lib.id) + this.$eventBus.$emit('library-changed', lib.id) this.$localStore.setCurrentLibrary(lib) } }, diff --git a/components/tables/CollectionBooksTable.vue b/components/tables/CollectionBooksTable.vue index 0b123fa9..5a21f6ca 100644 --- a/components/tables/CollectionBooksTable.vue +++ b/components/tables/CollectionBooksTable.vue @@ -9,7 +9,7 @@{{ totalDurationPretty }}
Fetching...
Nothing found
{{ item.data.book.title }}
-{{ item.data.book.author }}
-Books
+ +Series
+ +Authors
+ +