Skip to content

Commit e239adc

Browse files
committed
Fix fetching the channel thumbnail
1 parent 73419a8 commit e239adc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/renderer/components/distraction-settings/distraction-settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default defineComponent({
173173
if (tag.invalid) continue
174174

175175
// process if no preferred name and is possibly a YouTube ID
176-
if (tag.preferredName === '' && checkYoutubeChannelId(tag.name)) {
176+
if ((tag.preferredName === '' || !tag.icon) && checkYoutubeChannelId(tag.name)) {
177177
this.channelHiderDisabled = true
178178

179179
const { preferredName, icon, iconHref, invalidId } = await this.findChannelTagInfo(tag.name)

src/renderer/helpers/channels.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { invidiousGetChannelInfo } from './api/invidious'
2-
import { getLocalChannel } from './api/local'
2+
import { getLocalChannel, parseLocalChannelHeader } from './api/local'
33

44
/**
55
* @param {string} id
@@ -54,9 +54,12 @@ export async function findChannelTagInfo(id, backendOptions) {
5454
}
5555
} else {
5656
if (channel.alert) return { invalidId: true }
57+
58+
const { name, thumbnailUrl } = parseLocalChannelHeader(channel)
59+
5760
return {
58-
preferredName: channel.header.author.name,
59-
icon: channel.header.author.thumbnails.pop().url,
61+
preferredName: name,
62+
icon: thumbnailUrl,
6063
iconHref: `/channel/${id}`
6164
}
6265
}

0 commit comments

Comments
 (0)