Skip to content

Commit e560a8f

Browse files
authored
Update places generating sharable YT video URLs to always return prefix https://youtu.be/ (#4547)
* * Update places generating sharable YT video URLs to always return prefix https://youtu.be/ * ! Fix short form URL
1 parent 89b5f6b commit e560a8f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/renderer/components/ft-list-video/ft-list-video.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,12 @@ export default defineComponent({
192192
},
193193

194194
youtubeShareUrl: function () {
195+
const videoUrl = `https://youtu.be/${this.id}`
195196
if (this.playlistSharable) {
196197
// `index` seems can be ignored
197-
return `https://youtu.be/${this.id}?list=${this.playlistIdFinal}`
198+
return `${videoUrl}?list=${this.playlistIdFinal}`
198199
}
199-
return `https://youtu.be/${this.id}`
200+
return videoUrl
200201
},
201202

202203
youtubeChannelUrl: function () {

src/renderer/components/ft-share-button/ft-share-button.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ export default defineComponent({
127127
if (this.isPlaylist) {
128128
return this.youtubePlaylistUrl
129129
}
130+
const videoUrl = `https://youtu.be/${this.id}`
130131
if (this.playlistSharable) {
131132
// `index` seems can be ignored
132-
return `https://www.youtube.com/watch?v=${this.id}&list=${this.playlistId}`
133+
return `${videoUrl}?list=${this.playlistId}`
133134
}
134-
return `https://youtu.be/${this.id}`
135+
return videoUrl
135136
},
136137

137138
youtubeEmbedURL() {

0 commit comments

Comments
 (0)