Skip to content

Commit

Permalink
Fix playlist thumbnail not getting proxied through Invidious (#3581)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed May 23, 2023
1 parent da6acf2 commit 6f95673
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
}
},
Expand Down

0 comments on commit 6f95673

Please sign in to comment.