Skip to content

Commit

Permalink
Fix fetching the channel thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed May 22, 2024
1 parent 73419a8 commit e239adc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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
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

0 comments on commit e239adc

Please sign in to comment.