From b1111912f74a8eae70c2087b6deeed9d5937db62 Mon Sep 17 00:00:00 2001 From: Scott Ruoti Date: Thu, 3 Nov 2022 09:11:33 -0400 Subject: [PATCH] Added sorting by sequence for series and collapsing series in series view --- client/components/app/BookShelfToolbar.vue | 17 ++- client/components/app/LazyBookshelf.vue | 8 +- client/components/cards/LazyBookCard.vue | 16 ++- .../components/controls/LibrarySortSelect.vue | 130 +++++++++++------- server/controllers/LibraryController.js | 45 +++--- 5 files changed, 137 insertions(+), 79 deletions(-) diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index bbf30f6e..00da52c3 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -28,13 +28,19 @@ {{ numShowing }}
- + +
- - + + - +
Mark Series {{ isSeriesFinished ? 'Not Finished' : 'Finished' }} @@ -280,6 +286,9 @@ export default { updateCollapseSeries() { this.saveSettings() }, + updateCollapseBookSeries() { + this.saveSettings() + }, saveSettings() { this.$store.dispatch('user/updateUserSettings', this.settings) }, diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index c0798d19..9f289dc5 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -122,6 +122,9 @@ export default { collapseSeries() { return this.$store.getters['user/getUserSetting']('collapseSeries') }, + collapseBookSeries() { + return this.$store.getters['user/getUserSetting']('collapseBookSeries') + }, coverAspectRatio() { return this.$store.getters['libraries/getBookCoverAspectRatio'] }, @@ -452,6 +455,9 @@ export default { searchParams.set('filter', this.seriesFilterBy) } else if (this.page === 'series-books') { searchParams.set('filter', `series.${this.$encode(this.seriesId)}`) + if (this.collapseBookSeries) { + searchParams.set('collapseseries', 1) + } } else { if (this.filterBy && this.filterBy !== 'all') { searchParams.set('filter', this.filterBy) @@ -467,8 +473,6 @@ export default { return searchParams.toString() }, checkUpdateSearchParams() { - if (this.page === 'series-books') return false - var newSearchParams = this.buildSearchParams() var currentQueryString = window.location.search if (currentQueryString && currentQueryString.startsWith('?')) currentQueryString = currentQueryString.slice(1) diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 22b064de..85ac20a5 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -22,12 +22,16 @@ }}

-
#{{ seriesSequenceList }}
-
{{ booksInSeries }}
+
+

#{{ seriesSequenceList }}

+
+
+

{{ booksInSeries }}

+
- -
    +