From 4113ebb6bb5cbc3a99771a28bcdb3769e1b36cc0 Mon Sep 17 00:00:00 2001 From: Laptop Duane Date: Fri, 23 Oct 2020 10:50:33 +0200 Subject: [PATCH 1/2] Add Copy / Open Channel URL to video dropdown --- package-lock.json | 2 +- .../components/ft-list-video/ft-list-video.js | 24 +++++++++++++++++-- static/locales/en-US.yaml | 4 ++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f241cf889..f0015931f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "freetube", - "version": "0.9.0", + "version": "0.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { 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 7de0cf139..7ea55f3db 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -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 } }, diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 4e1f076b6..79a761720 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -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 From 29a80ef160fb538860feb4679d725ecd34841b3e Mon Sep 17 00:00:00 2001 From: Laptop Duane Date: Fri, 23 Oct 2020 12:51:39 +0200 Subject: [PATCH 2/2] Add Invidious channel url option to dropdown --- .../components/ft-list-video/ft-list-video.js | 24 +++++++++++++++++-- static/locales/en-US.yaml | 3 +++ 2 files changed, 25 insertions(+), 2 deletions(-) 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 7ea55f3db..7285f57db 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -52,7 +52,9 @@ export default Vue.extend({ 'openInvidious', 'copyInvidious', 'openYoutubeChannel', - 'copyYoutubeChannel' + 'copyYoutubeChannel', + 'openInvidiousChannel', + 'copyInvidiousChannel' ] } }, @@ -91,6 +93,10 @@ export default Vue.extend({ return `${this.invidiousInstance}/watch?v=${this.id}` }, + invidiousChannelUrl: function () { + return `${this.invidiousInstance}/channel/${this.channelId}` + }, + youtubeUrl: function () { return `https://www.youtube.com/watch?v=${this.id}` }, @@ -120,7 +126,9 @@ export default Vue.extend({ this.$t('Video.Open in Invidious'), this.$t('Video.Copy Invidious Link'), this.$t('Video.Open Channel in YouTube'), - this.$t('Video.Copy YouTube Channel Link') + this.$t('Video.Copy YouTube Channel Link'), + this.$t('Video.Open Channel in Invidious'), + this.$t('Video.Copy Invidious Channel Link') ] if (this.watched) { @@ -228,6 +236,18 @@ export default Vue.extend({ shell.openExternal(this.youtubeChannelUrl) } break + case 'copyInvidiousChannel': + navigator.clipboard.writeText(this.invidiousChannelUrl) + this.showToast({ + message: this.$t('Share.Invidious Channel URL copied to clipboard') + }) + break + case 'openInvidiousChannel': + if (this.usingElectron) { + const shell = require('electron').shell + shell.openExternal(this.invidiousChannelUrl) + } + break } }, diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 79a761720..2340884c2 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -396,6 +396,8 @@ Video: Copy Invidious Link: Copy Invidious Link Open Channel in YouTube: Open Channel in YouTube Copy YouTube Channel Link: Copy YouTube Channel Link + Open Channel in Invidious: Open Channel in Invidious + Copy Invidious Channel Link: Copy Invidious Channel Link View: View Views: Views Loop Playlist: Loop Playlist @@ -508,6 +510,7 @@ Share: # On Click Invidious URL copied to clipboard: Invidious URL copied to clipboard Invidious Embed URL copied to clipboard: Invidious Embed URL copied to clipboard + Invidious Channel URL copied to clipboard: Invidious Channel 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