diff --git a/components/app/Appbar.vue b/components/app/Appbar.vue index 16edc3c0..b7fe929d 100644 --- a/components/app/Appbar.vue +++ b/components/app/Appbar.vue @@ -46,6 +46,7 @@ export default { return this.currentLibrary ? this.currentLibrary.name : 'Main' }, showBack() { + if (!this.$route.name) return true return this.$route.name !== 'index' && !this.$route.name.startsWith('bookshelf') }, user() { diff --git a/components/bookshelf/LazyBookshelf.vue b/components/bookshelf/LazyBookshelf.vue index bcdd7e64..386b5fe4 100644 --- a/components/bookshelf/LazyBookshelf.vue +++ b/components/bookshelf/LazyBookshelf.vue @@ -327,13 +327,26 @@ export default { this.handleScroll(scrollTop) }, buildSearchParams() { - let searchParams = new URLSearchParams() - if (this.filterBy && this.filterBy !== 'all') { - searchParams.set('filter', this.filterBy) + if (this.page === 'search' || this.page === 'series' || this.page === 'collections') { + return '' } - if (this.orderBy) { - searchParams.set('sort', this.orderBy) - searchParams.set('desc', this.orderDesc ? 1 : 0) + + let searchParams = new URLSearchParams() + if (this.page === 'series-books') { + searchParams.set('filter', `series.${this.$encode(this.seriesId)}`) + searchParams.set('sort', 'book.volumeNumber') + searchParams.set('desc', 0) + } else { + if (this.filterBy && this.filterBy !== 'all') { + searchParams.set('filter', this.filterBy) + } + if (this.orderBy) { + searchParams.set('sort', this.orderBy) + searchParams.set('desc', this.orderDesc ? 1 : 0) + } + if (this.collapseSeries) { + searchParams.set('collapseseries', 1) + } } return searchParams.toString() }, diff --git a/components/bookshelf/Shelf.vue b/components/bookshelf/Shelf.vue index 8ef31151..6f6e7b3e 100644 --- a/components/bookshelf/Shelf.vue +++ b/components/bookshelf/Shelf.vue @@ -4,6 +4,7 @@ diff --git a/components/cards/AuthorCard.vue b/components/cards/AuthorCard.vue new file mode 100644 index 00000000..b8106ce9 --- /dev/null +++ b/components/cards/AuthorCard.vue @@ -0,0 +1,96 @@ + + + \ No newline at end of file diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index 986cc856..58f54c55 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -207,7 +207,7 @@ export default { return null }, userProgress() { - return this.store.getters['user/getUserLibraryItemProgress'](this.libraryItemId) + return this.store.getters['user/getUserMediaProgress'](this.libraryItemId) }, userProgressPercent() { return this.userProgress ? this.userProgress.progress || 0 : 0 diff --git a/components/cards/LazyListBookCard.vue b/components/cards/LazyListBookCard.vue index 906812fe..09784df3 100644 --- a/components/cards/LazyListBookCard.vue +++ b/components/cards/LazyListBookCard.vue @@ -171,7 +171,7 @@ export default { return null }, userProgress() { - return this.store.getters['user/getUserLibraryItemProgress'](this.libraryItemId) + return this.store.getters['user/getUserMediaProgress'](this.libraryItemId) }, userProgressPercent() { return this.userProgress ? this.userProgress.progress || 0 : 0 diff --git a/components/cards/LazySeriesCard.vue b/components/cards/LazySeriesCard.vue index 8bddec22..4724af39 100644 --- a/components/cards/LazySeriesCard.vue +++ b/components/cards/LazySeriesCard.vue @@ -56,7 +56,7 @@ export default { return this.store.state.libraries.currentLibraryId }, seriesId() { - return this.series ? this.$encode(this.series.id) : null + return this.series ? this.series.id : null }, hasValidCovers() { var validCovers = this.books.map((bookItem) => bookItem.book.cover) diff --git a/components/covers/AuthorImage.vue b/components/covers/AuthorImage.vue new file mode 100644 index 00000000..61e1c94b --- /dev/null +++ b/components/covers/AuthorImage.vue @@ -0,0 +1,87 @@ + + + \ No newline at end of file diff --git a/components/home/BookshelfToolbar.vue b/components/home/BookshelfToolbar.vue index ce7e05ab..28b5d58c 100644 --- a/components/home/BookshelfToolbar.vue +++ b/components/home/BookshelfToolbar.vue @@ -40,6 +40,7 @@ export default { return this.$store.state.globals.bookshelfListView }, set(val) { + this.$localStore.setBookshelfListView(val) this.$store.commit('globals/setBookshelfListView', val) } }, @@ -63,8 +64,8 @@ export default { return '' }, selectedSeriesName() { - if (this.page === 'series' && this.$route.params.id) { - return this.$decode(this.$route.params.id) + if (this.page === 'series' && this.$route.params.id && this.$store.state.globals.series) { + return this.$store.state.globals.series.name } return null } @@ -78,9 +79,10 @@ export default { }, saveSettings() { this.$store.commit('user/setSettings', this.settings) // Immediate update - this.$store.dispatch('user/updateUserSettings', this.settings) + this.$store.dispatch('user/updateUserSettings', this.settings) // TODO: No need to update settings on server... }, async init() { + this.bookshelfListView = await this.$localStore.getBookshelfListView() this.settings = { ...this.$store.state.user.settings } this.bookshelfReady = true }, diff --git a/components/modals/FilterModal.vue b/components/modals/FilterModal.vue index 51787552..83e95619 100644 --- a/components/modals/FilterModal.vue +++ b/components/modals/FilterModal.vue @@ -143,13 +143,20 @@ export default { return this.filterData.narrators || [] }, progress() { - return ['Read', 'Unread', 'In Progress'] + return ['Finished', 'In Progress', 'Not Started'] }, sublistItems() { return (this[this.sublist] || []).map((item) => { - return { - text: item, - value: this.$encode(item) + if (typeof item === 'string') { + return { + text: item, + value: this.$encode(item) + } + } else { + return { + text: item.name, + value: this.$encode(item.id) + } } }) }, diff --git a/components/tables/collection/BookTableRow.vue b/components/tables/collection/BookTableRow.vue index 940661d5..02c3ef96 100644 --- a/components/tables/collection/BookTableRow.vue +++ b/components/tables/collection/BookTableRow.vue @@ -2,12 +2,12 @@
- +
- {{ bookTitle }} - {{ bookAuthor }} + {{ bookTitle }} +

{{ bookAuthor }}

@@ -30,6 +30,24 @@ export default { } }, computed: { + media() { + return this.book.media || {} + }, + mediaMetadata() { + return this.media.metadata || {} + }, + tracks() { + return this.media.tracks || [] + }, + bookTitle() { + return this.mediaMetadata.title || '' + }, + bookAuthor() { + return this.mediaMetadata.authorName || '' + }, + bookDuration() { + return this.$secondsToTimestamp(this.media.duration) + }, bookCoverAspectRatio() { return this.$store.getters['getBookCoverAspectRatio'] }, @@ -37,18 +55,6 @@ export default { if (this.bookCoverAspectRatio === 1) return 80 return 50 }, - _book() { - return this.book.book || {} - }, - bookTitle() { - return this._book.title || '' - }, - bookAuthor() { - return this._book.authorFL || '' - }, - bookDuration() { - return this.$secondsToTimestamp(this.book.duration) - }, isMissing() { return this.book.isMissing }, @@ -66,10 +72,6 @@ export default { } }, methods: { - playClick() { - // this.$store.commit('setStreamAudiobook', this.book) - // this.$root.socket.emit('open_stream', this.book.id) - }, clickEdit() { this.$emit('edit', this.book) } diff --git a/pages/bookshelf/library.vue b/pages/bookshelf/library.vue index 264ece6f..9a35f603 100644 --- a/pages/bookshelf/library.vue +++ b/pages/bookshelf/library.vue @@ -4,10 +4,11 @@