mirror of https://github.com/FreeTubeApp/FreeTube
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:
parent
d2075718b4
commit
2296e3a58d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue