From 33f20d54cccc5e5e919715d144e50633b7da2a48 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 23 Apr 2023 17:08:36 -0500 Subject: [PATCH 01/13] Updated docker template xml --- docker-template.xml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/docker-template.xml b/docker-template.xml index 229f2774..cdd72b10 100644 --- a/docker-template.xml +++ b/docker-template.xml @@ -48,21 +48,9 @@ rw - - - 99 - AUDIOBOOKSHELF_UID - - - - 100 - AUDIOBOOKSHELF_GID - - - /mnt/user/appdata/audiobookshelf/config/ /mnt/user/appdata/audiobookshelf/metadata/ 13378 - + \ No newline at end of file From a5627a1b52b942d15444dfd0bd53c40a441f87c4 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 24 Apr 2023 18:25:30 -0500 Subject: [PATCH 02/13] Add:Search for narrators #1495 --- .../components/app/BookShelfCategorized.vue | 29 +++-- client/components/app/BookShelfRow.vue | 6 ++ client/components/cards/ItemSearchCard.vue | 9 +- client/components/cards/NarratorCard.vue | 50 +++++++++ .../components/cards/NarratorSearchCard.vue | 34 ++++++ client/components/controls/GlobalSearch.vue | 14 ++- client/components/widgets/NarratorsSlider.vue | 100 ++++++++++++++++++ client/pages/library/_library/search.vue | 33 +++--- server/controllers/LibraryController.js | 19 +++- server/objects/mediaTypes/Book.js | 7 +- server/objects/metadata/BookMetadata.js | 3 + 11 files changed, 271 insertions(+), 33 deletions(-) create mode 100644 client/components/cards/NarratorCard.vue create mode 100644 client/components/cards/NarratorSearchCard.vue create mode 100644 client/components/widgets/NarratorsSlider.vue diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index fe1d5df5..ca070e18 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -28,6 +28,9 @@

{{ $strings[shelf.labelStringKey] }}

+ +

{{ $strings[shelf.labelStringKey] }}

+
@@ -185,8 +188,8 @@ export default { this.shelves = categories }, async setShelvesFromSearch() { - var shelves = [] - if (this.results.books && this.results.books.length) { + const shelves = [] + if (this.results.books?.length) { shelves.push({ id: 'books', label: 'Books', @@ -196,7 +199,7 @@ export default { }) } - if (this.results.podcasts && this.results.podcasts.length) { + if (this.results.podcasts?.length) { shelves.push({ id: 'podcasts', label: 'Podcasts', @@ -206,7 +209,7 @@ export default { }) } - if (this.results.series && this.results.series.length) { + if (this.results.series?.length) { shelves.push({ id: 'series', label: 'Series', @@ -221,7 +224,7 @@ export default { }) }) } - if (this.results.tags && this.results.tags.length) { + if (this.results.tags?.length) { shelves.push({ id: 'tags', label: 'Tags', @@ -236,7 +239,7 @@ export default { }) }) } - if (this.results.authors && this.results.authors.length) { + if (this.results.authors?.length) { shelves.push({ id: 'authors', label: 'Authors', @@ -250,6 +253,20 @@ export default { }) }) } + if (this.results.narrators?.length) { + shelves.push({ + id: 'narrators', + label: 'Narrators', + labelStringKey: 'LabelNarrators', + type: 'narrators', + entities: this.results.narrators.map((n) => { + return { + ...n, + type: 'narrator' + } + }) + }) + } this.shelves = shelves }, scan() { diff --git a/client/components/app/BookShelfRow.vue b/client/components/app/BookShelfRow.vue index bd97d56a..60632db7 100644 --- a/client/components/app/BookShelfRow.vue +++ b/client/components/app/BookShelfRow.vue @@ -41,6 +41,11 @@ +
+ +
@@ -88,6 +93,7 @@ export default { return this.bookCoverWidth * this.bookCoverAspectRatio }, shelfHeight() { + if (this.shelf.type === 'narrators') return 148 return this.bookCoverHeight + 48 }, paddingLeft() { diff --git a/client/components/cards/ItemSearchCard.vue b/client/components/cards/ItemSearchCard.vue index f29888e5..1784db0f 100644 --- a/client/components/cards/ItemSearchCard.vue +++ b/client/components/cards/ItemSearchCard.vue @@ -10,7 +10,7 @@

by {{ authorName }}

-

+
@@ -67,12 +67,13 @@ export default { // but with removing commas periods etc this is no longer plausible const html = this.matchText - if (this.matchKey === 'episode') return `

Episode: ${html}

` - if (this.matchKey === 'tags') return `

Tags: ${html}

` + if (this.matchKey === 'episode') return `

${this.$strings.LabelEpisode}: ${html}

` + if (this.matchKey === 'tags') return `

${this.$strings.LabelTags}: ${html}

` if (this.matchKey === 'authors') return `by ${html}` if (this.matchKey === 'isbn') return `

ISBN: ${html}

` if (this.matchKey === 'asin') return `

ASIN: ${html}

` - if (this.matchKey === 'series') return `

Series: ${html}

` + if (this.matchKey === 'series') return `

${this.$strings.LabelSeries}: ${html}

` + if (this.matchKey === 'narrators') return `

${this.$strings.LabelNarrator}: ${html}

` return `${html}` } }, diff --git a/client/components/cards/NarratorCard.vue b/client/components/cards/NarratorCard.vue new file mode 100644 index 00000000..9d3e5a30 --- /dev/null +++ b/client/components/cards/NarratorCard.vue @@ -0,0 +1,50 @@ + + + \ No newline at end of file diff --git a/client/components/cards/NarratorSearchCard.vue b/client/components/cards/NarratorSearchCard.vue new file mode 100644 index 00000000..e147e079 --- /dev/null +++ b/client/components/cards/NarratorSearchCard.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/client/components/controls/GlobalSearch.vue b/client/components/controls/GlobalSearch.vue index 670eb6e7..3dbebf1c 100644 --- a/client/components/controls/GlobalSearch.vue +++ b/client/components/controls/GlobalSearch.vue @@ -63,6 +63,15 @@ + +

{{ $strings.LabelNarrators }}

+ @@ -84,6 +93,7 @@ export default { authorResults: [], seriesResults: [], tagResults: [], + narratorResults: [], searchTimeout: null, lastSearch: null } @@ -114,6 +124,7 @@ export default { this.authorResults = [] this.seriesResults = [] this.tagResults = [] + this.narratorResults = [] this.showMenu = false this.isFetching = false this.isTyping = false @@ -142,7 +153,7 @@ export default { } this.isFetching = true - var searchResults = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/search?q=${value}&limit=3`).catch((error) => { + const searchResults = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/search?q=${value}&limit=3`).catch((error) => { console.error('Search error', error) return [] }) @@ -155,6 +166,7 @@ export default { this.authorResults = searchResults.authors || [] this.seriesResults = searchResults.series || [] this.tagResults = searchResults.tags || [] + this.narratorResults = searchResults.narrators || [] this.isFetching = false if (!this.showMenu) { diff --git a/client/components/widgets/NarratorsSlider.vue b/client/components/widgets/NarratorsSlider.vue new file mode 100644 index 00000000..77302f6f --- /dev/null +++ b/client/components/widgets/NarratorsSlider.vue @@ -0,0 +1,100 @@ + + + \ No newline at end of file diff --git a/client/pages/library/_library/search.vue b/client/pages/library/_library/search.vue index b338323f..2f43d202 100644 --- a/client/pages/library/_library/search.vue +++ b/client/pages/library/_library/search.vue @@ -11,27 +11,27 @@