From f781fa9e6b63b9aa4af6d3446d6500bed5ab8b00 Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 21 Apr 2022 08:55:29 -0500 Subject: [PATCH] Add green finished line for series #454 --- client/components/cards/LazySeriesCard.vue | 18 ++++++++++++++++-- server/controllers/LibraryController.js | 5 ----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/client/components/cards/LazySeriesCard.vue b/client/components/cards/LazySeriesCard.vue index 3d545086..fba2ef8c 100644 --- a/client/components/cards/LazySeriesCard.vue +++ b/client/components/cards/LazySeriesCard.vue @@ -7,11 +7,12 @@
{{ books.length }}
+
+

{{ title }}

- +

{{ title }}

@@ -60,6 +61,19 @@ export default { books() { return this.series ? this.series.books || [] : [] }, + seriesBookProgress() { + return this.books + .map((libraryItem) => { + return this.store.getters['user/getUserMediaProgress'](libraryItem.id) + }) + .filter((p) => !!p) + }, + seriesBooksFinished() { + return this.seriesBookProgress.filter((p) => p.isFinished) + }, + isSeriesFinished() { + return this.books.length === this.seriesBooksFinished.length + }, store() { return this.$store || this.$nuxt.$store }, diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index 8e93bac2..f4584ab6 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -224,12 +224,7 @@ class LibraryController { } var series = libraryHelpers.getSeriesFromBooks(libraryItems, payload.minified) - - var sortingIgnorePrefix = this.db.serverSettings.sortingIgnorePrefix series = sort(series).asc(s => { - if (sortingIgnorePrefix && s.name.toLowerCase().startsWith('the ')) { - return s.name.substr(4) - } return s.name }) payload.total = series.length