diff --git a/src/renderer/components/ft-list-video/ft-list-video.js b/src/renderer/components/ft-list-video/ft-list-video.js index 0ef6accf..bed3de09 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -42,16 +42,31 @@ export default Vue.extend({ return this.$store.getters.getThumbnailPreference }, + backendPreference: function () { + return this.$store.getters.getBackendPreference + }, + + invidiousInstance: function () { + return this.$store.getters.getInvidiousInstance + }, + thumbnail: function () { + let baseUrl + if (this.backendPreference === 'invidious') { + baseUrl = this.invidiousInstance + } else { + baseUrl = 'https://i.ytimg.com' + } + switch (this.thumbnailPreference) { case 'start': - return `https://i.ytimg.com/vi/${this.id}/mq1.jpg` + return `${baseUrl}/vi/${this.id}/mq1.jpg` case 'middle': - return `https://i.ytimg.com/vi/${this.id}/mq2.jpg` + return `${baseUrl}/vi/${this.id}/mq2.jpg` case 'end': - return `https://i.ytimg.com/vi/${this.id}/mq3.jpg` + return `${baseUrl}/vi/${this.id}/mq3.jpg` default: - return `https://i.ytimg.com/vi/${this.id}/mqdefault.jpg` + return `${baseUrl}/vi/${this.id}/mqdefault.jpg` } } }, diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 3533c7d7..0b41cf2b 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -98,15 +98,22 @@ export default Vue.extend({ }, thumbnail: function () { + let baseUrl + if (this.backendPreference === 'invidious') { + baseUrl = this.invidiousInstance + } else { + baseUrl = 'https://i.ytimg.com' + } + switch (this.thumbnailPreference) { case 'start': - return `https://i.ytimg.com/vi/${this.videoId}/mq1.jpg` + return `${baseUrl}/vi/${this.videoId}/maxres1.jpg` case 'middle': - return `https://i.ytimg.com/vi/${this.videoId}/mq2.jpg` + return `${baseUrl}/vi/${this.videoId}/maxres2.jpg` case 'end': - return `https://i.ytimg.com/vi/${this.videoId}/mq3.jpg` + return `${baseUrl}/vi/${this.videoId}/maxres3.jpg` default: - return `https://i.ytimg.com/vi/${this.videoId}/mqdefault.jpg` + return `${baseUrl}/vi/${this.videoId}/maxresdefault.jpg` } },