From ddd2c0ae4e596159dc7f391ef792749865074197 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 12 Oct 2024 15:56:49 -0500 Subject: [PATCH] Add:Filter for missing chapters & alphabetize missing subitems #3497 --- .../controls/LibraryFilterSelect.vue | 32 +++++++++++-------- .../utils/queries/libraryItemsBookFilters.js | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/client/components/controls/LibraryFilterSelect.vue b/client/components/controls/LibraryFilterSelect.vue index ba96f103..2d9ced5a 100644 --- a/client/components/controls/LibraryFilterSelect.vue +++ b/client/components/controls/LibraryFilterSelect.vue @@ -413,21 +413,17 @@ export default { id: 'isbn', name: 'ISBN' }, - { - id: 'subtitle', - name: this.$strings.LabelSubtitle - }, { id: 'authors', name: this.$strings.LabelAuthor }, { - id: 'publishedYear', - name: this.$strings.LabelPublishYear + id: 'chapters', + name: this.$strings.LabelChapters }, { - id: 'series', - name: this.$strings.LabelSeries + id: 'cover', + name: this.$strings.LabelCover }, { id: 'description', @@ -438,24 +434,32 @@ export default { name: this.$strings.LabelGenres }, { - id: 'tags', - name: this.$strings.LabelTags + id: 'language', + name: this.$strings.LabelLanguage }, { id: 'narrators', name: this.$strings.LabelNarrator }, + { + id: 'publishedYear', + name: this.$strings.LabelPublishYear + }, { id: 'publisher', name: this.$strings.LabelPublisher }, { - id: 'language', - name: this.$strings.LabelLanguage + id: 'series', + name: this.$strings.LabelSeries }, { - id: 'cover', - name: this.$strings.LabelCover + id: 'subtitle', + name: this.$strings.LabelSubtitle + }, + { + id: 'tags', + name: this.$strings.LabelTags } ] }, diff --git a/server/utils/queries/libraryItemsBookFilters.js b/server/utils/queries/libraryItemsBookFilters.js index 43ffafef..e64e7b78 100644 --- a/server/utils/queries/libraryItemsBookFilters.js +++ b/server/utils/queries/libraryItemsBookFilters.js @@ -219,7 +219,7 @@ module.exports = { mediaWhere[key] = { [Sequelize.Op.or]: [null, ''] } - } else if (['genres', 'tags', 'narrators'].includes(value)) { + } else if (['genres', 'tags', 'narrators', 'chapters'].includes(value)) { mediaWhere[value] = { [Sequelize.Op.or]: [null, Sequelize.where(Sequelize.fn('json_array_length', Sequelize.col(value)), 0)] }