From 2296e3a58d1895556bcec52b2162861140f295f8 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Tue, 1 Aug 2023 00:47:52 -0700 Subject: [PATCH] Fix: importing subscriptions with terminated channels (#3816) * Fix: Cannot read properties of undefined (reading 'author') * fix importing some newpipe subscriptions only check url, not service_id --- src/renderer/components/data-settings/data-settings.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 877ac05ce..bb2050fc8 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -421,7 +421,7 @@ export default defineComponent({ } const newPipeSubscriptions = newPipeData.subscriptions.filter((channel, index) => { - return channel.service_id === 0 + return new URL(channel.url).hostname === 'www.youtube.com' }) const subscriptions = [] @@ -1035,10 +1035,9 @@ export default defineComponent({ invidiousAPICall(subscriptionsPayload).then((response) => { resolve(response) }).catch((err) => { - console.error(err) const errorMessage = this.$t('Invidious API Error (Click to copy)') - showToast(`${errorMessage}: ${err.responseJSON.error}`, 10000, () => { - copyToClipboard(err.responseJSON.error) + showToast(`${errorMessage}: ${err}`, 10000, () => { + copyToClipboard(err) }) if (process.env.IS_ELECTRON && this.backendFallback && this.backendPreference === 'invidious') { @@ -1056,7 +1055,7 @@ export default defineComponent({ const channel = await getLocalChannel(channelId) if (channel.alert) { - return undefined + return [] } return {