From 02231537f91c98fec1146e4ed7524ee0a175c8ff Mon Sep 17 00:00:00 2001 From: fatpowaranga <25446297+fatpowaranga@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:11:50 +1000 Subject: [PATCH] Use shorter youtu.be links instead of youtube.com for YouTube share links (#671) --- src/renderer/components/ft-list-video/ft-list-video.js | 6 +++++- src/renderer/components/ft-share-button/ft-share-button.js | 6 +++++- 2 files changed, 10 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 e9f79b3b..7de0cf13 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.js +++ b/src/renderer/components/ft-list-video/ft-list-video.js @@ -93,6 +93,10 @@ export default Vue.extend({ return `https://www.youtube.com/watch?v=${this.id}` }, + youtubeShareUrl: function () { + return `https://youtu.be/${this.id}` + }, + youtubeEmbedUrl: function () { return `https://www.youtube-nocookie.com/embed/${this.id}` }, @@ -168,7 +172,7 @@ export default Vue.extend({ } break case 'copyYoutube': - navigator.clipboard.writeText(this.youtubeUrl) + navigator.clipboard.writeText(this.youtubeShareUrl) this.showToast({ message: this.$t('Share.YouTube URL copied to clipboard') }) diff --git a/src/renderer/components/ft-share-button/ft-share-button.js b/src/renderer/components/ft-share-button/ft-share-button.js index acc18088..eaf9068f 100644 --- a/src/renderer/components/ft-share-button/ft-share-button.js +++ b/src/renderer/components/ft-share-button/ft-share-button.js @@ -50,6 +50,10 @@ export default Vue.extend({ return `https://www.youtube.com/watch?v=${this.id}` }, + youtubeShareURL() { + return `https://youtu.be/${this.id}` + }, + youtubeEmbedURL() { return `https://www.youtube-nocookie.com/embed/${this.id}` } @@ -88,7 +92,7 @@ export default Vue.extend({ this.showToast({ message: this.$t('Share.YouTube URL copied to clipboard') }) - this.copy(this.getFinalUrl(this.youtubeURL)) + this.copy(this.getFinalUrl(this.youtubeShareURL)) this.$refs.iconButton.focusOut() },