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
This commit is contained in:
ChunkyProgrammer 2023-08-01 00:47:52 -07:00 committed by GitHub
parent d2075718b4
commit 2296e3a58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -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 {