Update jsdocs for search podcasts

This commit is contained in:
advplyr 2024-02-17 13:24:49 -06:00
parent 2ec52a7a45
commit 180c328ed1
5 changed files with 62 additions and 8 deletions

View file

@ -87,7 +87,7 @@ export default {
streamLibraryItem() {
return this.$store.state.streamLibraryItem
},
librarySetting() {
librarySettings() {
return this.$store.getters['libraries/getCurrentLibrarySettings']
}
},
@ -154,7 +154,12 @@ export default {
async submitSearch(term) {
this.processing = true
this.termSearched = ''
let results = await this.$axios.$get(`/api/search/podcast?term=${encodeURIComponent(term)}&country=${encodeURIComponent(this.librarySetting?.podcastSearchRegion)}`).catch((error) => {
const searchParams = new URLSearchParams({
term,
country: this.librarySettings?.podcastSearchRegion || 'us'
})
let results = await this.$axios.$get(`/api/search/podcast?${searchParams.toString()}`).catch((error) => {
console.error('Search request failed', error)
return []
})