diff --git a/components/modals/PodcastEpisodesFeedModal.vue b/components/modals/PodcastEpisodesFeedModal.vue
new file mode 100644
index 00000000..91005ce9
--- /dev/null
+++ b/components/modals/PodcastEpisodesFeedModal.vue
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+ download_done
+
+
+
+
#{{ episode.episode }}
+
{{ episode.title }}
+
{{ episode.subtitle }}
+
Published {{ episode.publishedAt ? $dateDistanceFromNow(episode.publishedAt) : 'Unknown' }}
+
+
+
+
+
+ Download Episodes
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue
index 76b6bcb9..80553154 100644
--- a/components/tables/podcast/EpisodesTable.vue
+++ b/components/tables/podcast/EpisodesTable.vue
@@ -2,7 +2,14 @@
Episodes ({{ episodesFiltered.length }})
+
+
+
+
+
@@ -86,7 +95,10 @@ export default {
text: 'Complete',
value: 'complete'
}
- ]
+ ],
+ fetchingRSSFeed: false,
+ podcastFeedEpisodes: [],
+ showPodcastEpisodeFeed: false
}
},
watch: {
@@ -98,9 +110,18 @@ export default {
}
},
computed: {
+ isAdminOrUp() {
+ return this.$store.getters['user/getIsAdminOrUp']
+ },
libraryItemId() {
return this.libraryItem ? this.libraryItem.id : null
},
+ media() {
+ return this.libraryItem ? this.libraryItem.media || {} : {}
+ },
+ mediaMetadata() {
+ return this.media.metadata || {}
+ },
episodesAreFiltered() {
return this.episodesFiltered.length !== this.episodesCopy.length
},
@@ -146,6 +167,29 @@ export default {
}
},
methods: {
+ async searchEpisodes() {
+ if (!this.mediaMetadata.feedUrl) {
+ return this.$toast.error('Podcast does not have an RSS Feed')
+ }
+ this.fetchingRSSFeed = true
+ const 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 (!payload) return
+
+ 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
+ }
+
+ this.podcastFeedEpisodes = podcastfeed.episodes
+ this.showPodcastEpisodeFeed = true
+ },
addEpisodeToPlaylist(episode) {
this.$store.commit('globals/setSelectedPlaylistItems', [{ libraryItem: this.libraryItem, episode }])
this.$store.commit('globals/setShowPlaylistsAddCreateModal', true)