+
-
@@ -62,7 +65,9 @@ export default {
processing: false,
showNewPodcastModal: false,
selectedPodcast: null,
- selectedPodcastFeed: null
+ selectedPodcastFeed: null,
+ showOPMLFeedsModal: false,
+ opmlFeeds: []
}
},
computed: {
@@ -71,6 +76,36 @@ export default {
}
},
methods: {
+ async opmlFileUpload(file) {
+ this.processing = true
+ var txt = await new Promise((resolve) => {
+ const reader = new FileReader()
+ reader.onload = () => {
+ resolve(reader.result)
+ }
+ reader.readAsText(file)
+ })
+
+ if (!txt || !txt.includes('
tag not found OR an tag was not found')
+ this.processing = false
+ return
+ }
+
+ await this.$axios
+ .$post(`/api/podcasts/opml`, { opmlText: txt })
+ .then((data) => {
+ console.log(data)
+ this.opmlFeeds = data.feeds || []
+ this.showOPMLFeedsModal = true
+ })
+ .catch((error) => {
+ console.error('Failed', error)
+ this.$toast.error('Failed to parse OPML file')
+ })
+ this.processing = false
+ },
submit() {
if (!this.searchInput) return
diff --git a/client/pages/upload/index.vue b/client/pages/upload/index.vue
index 8378005b..e4dd8311 100644
--- a/client/pages/upload/index.vue
+++ b/client/pages/upload/index.vue
@@ -64,8 +64,8 @@
-