From 92ae0f28faba57fb23e610eb87b86cccef2f05bc Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 22 May 2023 22:36:49 +0200 Subject: [PATCH] Fix playlist thumbnail not getting proxied through Invidious --- .../components/playlist-info/playlist-info.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/playlist-info/playlist-info.js b/src/renderer/components/playlist-info/playlist-info.js index 5323e29d28bed..907417ba58431 100644 --- a/src/renderer/components/playlist-info/playlist-info.js +++ b/src/renderer/components/playlist-info/playlist-info.js @@ -41,20 +41,31 @@ export default defineComponent({ return this.$store.getters.getThumbnailPreference }, + backendPreference: function () { + return this.$store.getters.getBackendPreference + }, + hideViews: function () { return this.$store.getters.getHideVideoViews }, thumbnail: function () { + let baseUrl + if (this.backendPreference === 'invidious') { + baseUrl = this.currentInvidiousInstance + } else { + baseUrl = 'https://i.ytimg.com' + } + switch (this.thumbnailPreference) { case 'start': - return `https://i.ytimg.com/vi/${this.firstVideoId}/mq1.jpg` + return `${baseUrl}/vi/${this.firstVideoId}/mq1.jpg` case 'middle': - return `https://i.ytimg.com/vi/${this.firstVideoId}/mq2.jpg` + return `${baseUrl}/vi/${this.firstVideoId}/mq2.jpg` case 'end': - return `https://i.ytimg.com/vi/${this.firstVideoId}/mq3.jpg` + return `${baseUrl}/vi/${this.firstVideoId}/mq3.jpg` default: - return `https://i.ytimg.com/vi/${this.firstVideoId}/mqdefault.jpg` + return `${baseUrl}/vi/${this.firstVideoId}/mqdefault.jpg` } } },