From 1390276d554bd87f27745bff170531707c42b278 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Thu, 7 Oct 2021 02:36:13 -0400 Subject: [PATCH] [Fix] Invidious not used for channels icons in search (#1477) * fix channel icons * Add comment Co-authored-by: PikachuEXE Co-authored-by: Preston Co-authored-by: PikachuEXE --- .../components/ft-list-channel/ft-list-channel.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/ft-list-channel/ft-list-channel.js b/src/renderer/components/ft-list-channel/ft-list-channel.js index 51639d56..c4525fcf 100644 --- a/src/renderer/components/ft-list-channel/ft-list-channel.js +++ b/src/renderer/components/ft-list-channel/ft-list-channel.js @@ -66,7 +66,16 @@ export default Vue.extend({ }, parseInvidiousData: function () { - this.thumbnail = this.data.authorThumbnails[2].url.replace('https://yt3.ggpht.com', `${this.currentInvidiousInstance}/ggpht/`) + // Can be prefixed with `https://` or `//` (protocol relative) + let thumbnailUrl = this.data.authorThumbnails[2].url + + // Update protocol relative URL to be prefixed with `https://` + if (thumbnailUrl.startsWith('//')) { + thumbnailUrl = `https:${thumbnailUrl}` + } + + this.thumbnail = thumbnailUrl.replace('https://yt3.ggpht.com', `${this.currentInvidiousInstance}/ggpht/`) + this.channelName = this.data.author this.id = this.data.authorId if (this.hideChannelSubscriptions) {