From 87df022af06290af30d43bc07fb6ec0fe322e1f2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 19 May 2023 17:18:31 -0500 Subject: [PATCH] Add:Narrators in search results --- components/cards/AuthorSearchCard.vue | 20 --------------- components/cards/ItemSearchCard.vue | 5 +++- components/cards/NarratorSearchCard.vue | 34 +++++++++++++++++++++++++ pages/search.vue | 26 ++++++++++++++----- 4 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 components/cards/NarratorSearchCard.vue diff --git a/components/cards/AuthorSearchCard.vue b/components/cards/AuthorSearchCard.vue index 5db367e1..6afbab77 100644 --- a/components/cards/AuthorSearchCard.vue +++ b/components/cards/AuthorSearchCard.vue @@ -7,26 +7,6 @@

{{ name }}

- + + \ No newline at end of file diff --git a/pages/search.vue b/pages/search.vue index f7f747f4..d71d01cb 100644 --- a/pages/search.vue +++ b/pages/search.vue @@ -41,7 +41,16 @@ + +

Narrators

+ @@ -60,7 +69,8 @@ export default { bookResults: [], podcastResults: [], seriesResults: [], - authorResults: [] + authorResults: [], + narratorResults: [] } }, computed: { @@ -71,7 +81,7 @@ export default { return this.$store.getters['libraries/getBookCoverAspectRatio'] }, totalResults() { - return this.bookResults.length + this.seriesResults.length + this.authorResults.length + this.podcastResults.length + return this.bookResults.length + this.seriesResults.length + this.authorResults.length + this.podcastResults.length + this.narratorResults.length } }, methods: { @@ -86,6 +96,7 @@ export default { this.podcastResults = [] this.seriesResults = [] this.authorResults = [] + this.narratorResults = [] return } this.isFetching = true @@ -101,10 +112,11 @@ export default { this.isFetching = false - this.bookResults = results ? results.book || [] : [] - this.podcastResults = results ? results.podcast || [] : [] - this.seriesResults = results ? results.series || [] : [] - this.authorResults = results ? results.authors || [] : [] + this.bookResults = results?.book || [] + this.podcastResults = results?.podcast || [] + this.seriesResults = results?.series || [] + this.authorResults = results?.authors || [] + this.narratorResults = results?.narrators || [] }, updateSearch(val) { clearTimeout(this.searchTimeout)