mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-27 06:09:38 +00:00
Update jsdocs for search podcasts
This commit is contained in:
parent
2ec52a7a45
commit
180c328ed1
5 changed files with 62 additions and 8 deletions
|
|
@ -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 []
|
||||
})
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@ Vue.prototype.$languageCodeOptions = Object.keys(languageCodeMap).map(code => {
|
|||
value: code
|
||||
}
|
||||
})
|
||||
|
||||
// iTunes search API uses ISO 3166 country codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
const podcastSearchRegionMap = {
|
||||
'us': { label: 'United States' },
|
||||
'cn': { label: '中国' },
|
||||
'cn': { label: '中国' }
|
||||
}
|
||||
Vue.prototype.$podcastSearchRegionOptions = Object.keys(podcastSearchRegionMap).map(code => {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue