Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down Expand Up @@ -751,15 +751,15 @@ 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 }))
},

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 }))
},
Expand Down
9 changes: 6 additions & 3 deletions src/renderer/helpers/channels.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { invidiousGetChannelInfo } from './api/invidious'
import { getLocalChannel } from './api/local'
import { getLocalChannel, parseLocalChannelHeader } from './api/local'

/**
* @param {string} id
Expand Down Expand Up @@ -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}`
}
}
Expand Down