mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-15 02:18:27 +01:00
Update:Filter out podcasts from search that dont have an RSS feed url #1514
This commit is contained in:
parent
e07e2cd359
commit
d86a3b3dc2
@ -146,11 +146,15 @@ export default {
|
||||
async submitSearch(term) {
|
||||
this.processing = true
|
||||
this.termSearched = ''
|
||||
var results = await this.$axios.$get(`/api/search/podcast?term=${encodeURIComponent(term)}`).catch((error) => {
|
||||
let results = await this.$axios.$get(`/api/search/podcast?term=${encodeURIComponent(term)}`).catch((error) => {
|
||||
console.error('Search request failed', error)
|
||||
return []
|
||||
})
|
||||
console.log('Got results', results)
|
||||
|
||||
// Filter out podcasts without an RSS feed
|
||||
results = results.filter((r) => r.feedUrl)
|
||||
|
||||
for (let result of results) {
|
||||
let podcast = this.existentPodcasts.find((p) => p.itunesId === result.id || p.title === result.title.toLowerCase())
|
||||
if (podcast) {
|
||||
@ -173,7 +177,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.processing = true
|
||||
var payload = await this.$axios.$post(`/api/podcasts/feed`, {rssFeed: podcast.feedUrl}).catch((error) => {
|
||||
const payload = await this.$axios.$post(`/api/podcasts/feed`, { rssFeed: podcast.feedUrl }).catch((error) => {
|
||||
console.error('Failed to get feed', error)
|
||||
this.$toast.error('Failed to get podcast feed')
|
||||
return null
|
||||
|
Loading…
Reference in New Issue
Block a user