Update podcast search page to support manually entering podcast RSS feed

This commit is contained in:
advplyr 2022-04-13 16:55:48 -05:00
parent 2c6e1cc2b5
commit 4edba20e9e
6 changed files with 87 additions and 37 deletions

View file

@ -342,15 +342,16 @@ export default {
return this.$toast.error('Podcast does not have an RSS Feed')
}
this.fetchingRSSFeed = true
var podcastfeed = await this.$axios.$post(`/api/podcasts/feed`, { rssFeed: this.mediaMetadata.feedUrl }).catch((error) => {
var payload = await this.$axios.$post(`/api/podcasts/feed`, { rssFeed: this.mediaMetadata.feedUrl }).catch((error) => {
console.error('Failed to get feed', error)
this.$toast.error('Failed to get podcast feed')
return null
})
this.fetchingRSSFeed = false
if (!podcastfeed) return
if (!payload) return
console.log('Podcast feed', podcastfeed)
console.log('Podcast feed', payload)
const podcastfeed = payload.podcast
if (!podcastfeed.episodes || !podcastfeed.episodes.length) {
this.$toast.info('No episodes found in RSS feed')
return