mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-12-14 21:50:50 +01:00
Update copy/open YT video in playlist view to have playlist ID when present (#2848)
* * Update copy/open YT video in playlist view to have playlist ID when present * * Update YT share URL for video with playlist
This commit is contained in:
parent
08bba94a54
commit
fa9a992a52
@ -98,7 +98,13 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
invidiousUrl: function () {
|
||||
return `${this.currentInvidiousInstance}/watch?v=${this.id}`
|
||||
let videoUrl = `${this.currentInvidiousInstance}/watch?v=${this.id}`
|
||||
// `playlistId` can be undefined
|
||||
if (this.playlistId && this.playlistId.length !== 0) {
|
||||
// `index` seems can be ignored
|
||||
videoUrl += `&list=${this.playlistId}`
|
||||
}
|
||||
return videoUrl
|
||||
},
|
||||
|
||||
invidiousChannelUrl: function () {
|
||||
@ -106,10 +112,21 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
youtubeUrl: function () {
|
||||
return `https://www.youtube.com/watch?v=${this.id}`
|
||||
let videoUrl = `https://www.youtube.com/watch?v=${this.id}`
|
||||
// `playlistId` can be undefined
|
||||
if (this.playlistId && this.playlistId.length !== 0) {
|
||||
// `index` seems can be ignored
|
||||
videoUrl += `&list=${this.playlistId}`
|
||||
}
|
||||
return videoUrl
|
||||
},
|
||||
|
||||
youtubeShareUrl: function () {
|
||||
// `playlistId` can be undefined
|
||||
if (this.playlistId && this.playlistId.length !== 0) {
|
||||
// `index` seems can be ignored
|
||||
return `https://youtu.be/${this.id}?list=${this.playlistId}`
|
||||
}
|
||||
return `https://youtu.be/${this.id}`
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user