diff --git a/src/renderer/components/distraction-settings/distraction-settings.js b/src/renderer/components/distraction-settings/distraction-settings.js index a540b94bde48b..cdb0f4f0159b6 100644 --- a/src/renderer/components/distraction-settings/distraction-settings.js +++ b/src/renderer/components/distraction-settings/distraction-settings.js @@ -173,7 +173,7 @@ export default defineComponent({ if (tag.invalid) continue // process if no preferred name and is possibly a YouTube ID - if (tag.preferredName === '' && checkYoutubeChannelId(tag.name)) { + if ((tag.preferredName === '' || !tag.icon) && checkYoutubeChannelId(tag.name)) { this.channelHiderDisabled = true const { preferredName, icon, iconHref, invalidId } = await this.findChannelTagInfo(tag.name) diff --git a/src/renderer/components/ft-list-video/ft-list-video.js b/src/renderer/components/ft-list-video/ft-list-video.js index 578e1f4cf9fd7..dcd6795ade1bf 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -292,7 +292,7 @@ export default defineComponent({ if (this.channelId !== null) { const hiddenChannels = JSON.parse(this.$store.getters.getChannelsHidden) - const channelShouldBeHidden = hiddenChannels.some(c => c === this.channelId) + const channelShouldBeHidden = hiddenChannels.some(c => c.name === this.channelId) options.push( { @@ -751,7 +751,7 @@ export default defineComponent({ hideChannel: function(channelName, channelId) { const hiddenChannels = JSON.parse(this.$store.getters.getChannelsHidden) - hiddenChannels.push(channelId) + hiddenChannels.push({ name: channelId, preferredName: channelName }) this.updateChannelsHidden(JSON.stringify(hiddenChannels)) showToast(this.$t('Channel Hidden', { channel: channelName })) @@ -759,7 +759,7 @@ export default defineComponent({ unhideChannel: function(channelName, channelId) { const hiddenChannels = JSON.parse(this.$store.getters.getChannelsHidden) - this.updateChannelsHidden(JSON.stringify(hiddenChannels.filter(c => c !== channelId))) + this.updateChannelsHidden(JSON.stringify(hiddenChannels.filter(c => c.name !== channelId))) showToast(this.$t('Channel Unhidden', { channel: channelName })) }, diff --git a/src/renderer/helpers/channels.js b/src/renderer/helpers/channels.js index e343bdbac24ab..3161e5f8dcec8 100644 --- a/src/renderer/helpers/channels.js +++ b/src/renderer/helpers/channels.js @@ -1,5 +1,5 @@ import { invidiousGetChannelInfo } from './api/invidious' -import { getLocalChannel } from './api/local' +import { getLocalChannel, parseLocalChannelHeader } from './api/local' /** * @param {string} id @@ -54,9 +54,12 @@ export async function findChannelTagInfo(id, backendOptions) { } } else { if (channel.alert) return { invalidId: true } + + const { name, thumbnailUrl } = parseLocalChannelHeader(channel) + return { - preferredName: channel.header.author.name, - icon: channel.header.author.thumbnails.pop().url, + preferredName: name, + icon: thumbnailUrl, iconHref: `/channel/${id}` } }