Add Copy / Open Channel URL to video dropdown

This commit is contained in:
Laptop Duane 2020-10-23 10:50:33 +02:00
parent 45093859eb
commit 4113ebb6bb
3 changed files with 27 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "freetube",
"version": "0.9.0",
"version": "0.9.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -50,7 +50,9 @@ export default Vue.extend({
'openYoutubeEmbed',
'copyYoutubeEmbed',
'openInvidious',
'copyInvidious'
'copyInvidious',
'openYoutubeChannel',
'copyYoutubeChannel'
]
}
},
@ -97,6 +99,10 @@ export default Vue.extend({
return `https://youtu.be/${this.id}`
},
youtubeChannelUrl: function () {
return `https://youtube.com/channel/${this.channelId}`
},
youtubeEmbedUrl: function () {
return `https://www.youtube-nocookie.com/embed/${this.id}`
},
@ -112,7 +118,9 @@ export default Vue.extend({
this.$t('Video.Open YouTube Embedded Player'),
this.$t('Video.Copy YouTube Embedded Player Link'),
this.$t('Video.Open in Invidious'),
this.$t('Video.Copy Invidious Link')
this.$t('Video.Copy Invidious Link'),
this.$t('Video.Open Channel in YouTube'),
this.$t('Video.Copy YouTube Channel Link')
]
if (this.watched) {
@ -208,6 +216,18 @@ export default Vue.extend({
shell.openExternal(this.invidiousUrl)
}
break
case 'copyYoutubeChannel':
navigator.clipboard.writeText(this.youtubeChannelUrl)
this.showToast({
message: this.$t('Share.YouTube Channel URL copied to clipboard')
})
break
case 'openYoutubeChannel':
if (this.usingElectron) {
const shell = require('electron').shell
shell.openExternal(this.youtubeChannelUrl)
}
break
}
},

View File

@ -394,6 +394,8 @@ Video:
Copy YouTube Embedded Player Link: Copy YouTube Embedded Player Link
Open in Invidious: Open in Invidious
Copy Invidious Link: Copy Invidious Link
Open Channel in YouTube: Open Channel in YouTube
Copy YouTube Channel Link: Copy YouTube Channel Link
View: View
Views: Views
Loop Playlist: Loop Playlist
@ -508,6 +510,8 @@ Share:
Invidious Embed URL copied to clipboard: Invidious Embed URL copied to clipboard
YouTube URL copied to clipboard: YouTube URL copied to clipboard
YouTube Embed URL copied to clipboard: YouTube Embed URL copied to clipboard
YouTube Channel URL copied to clipboard: YouTube Channel URL copied to clipboard
Mini Player: Mini Player
Comments:
Comments: Comments