From 20e1d80d16710aeabcca4447cb353b4bb0a58bf3 Mon Sep 17 00:00:00 2001 From: Preston Date: Mon, 28 Sep 2020 19:53:59 -0400 Subject: [PATCH] Support gPodder OPML Export files --- .../components/data-settings/data-settings.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 4ce094f8b..4056423f0 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -195,7 +195,7 @@ export default Vue.extend({ filters: [ { name: 'Database File', - extensions: ['*'] + extensions: ['opml', 'xml'] } ] } @@ -219,6 +219,7 @@ export default Vue.extend({ opmlToJson(data, async (err, json) => { if (err) { console.log(err) + console.log('error reading') const message = this.$t('Settings.Data Settings.Invalid subscriptions file') this.showToast({ message: `${message}: ${err}` @@ -226,15 +227,19 @@ export default Vue.extend({ return } - const feedData = json.children[0].children + let feedData = json.children[0].children if (typeof feedData === 'undefined') { - const message = this.$t('Settings.Data Settings.Invalid subscriptions file') - this.showToast({ - message: message - }) + if (json.title.includes('gPodder')) { + feedData = json.children + } else { + const message = this.$t('Settings.Data Settings.Invalid subscriptions file') + this.showToast({ + message: message + }) - return + return + } } const primaryProfile = JSON.parse(JSON.stringify(this.profileList[0]))