From ab4001aade0891b70e456a215ced0f825c57fde8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Oct 2021 14:11:58 +0200 Subject: Provide origin URL to client and fix remote share --- .../+video-watch/shared/metadata/video-attributes.component.html | 2 +- .../+video-watch/shared/metadata/video-attributes.component.ts | 8 -------- client/src/app/shared/shared-main/video/video.model.ts | 2 +- client/src/app/shared/shared-share-modal/video-share.component.ts | 8 ++++---- 4 files changed, 6 insertions(+), 14 deletions(-) (limited to 'client') diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html index 362a21905..d65c9356a 100644 --- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html +++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.html @@ -12,7 +12,7 @@ diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts index 9429581ac..b8f564c4c 100644 --- a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts +++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts @@ -9,14 +9,6 @@ import { VideoDetails } from '@app/shared/shared-main' export class VideoAttributesComponent { @Input() video: VideoDetails - getVideoUrl () { - if (!this.video.url) { - return this.video.originInstanceUrl + VideoDetails.buildWatchUrl(this.video) - } - - return this.video.url - } - getVideoHost () { return this.video.channel.host } diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 7471a933b..10caec014 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -52,7 +52,7 @@ export class Video implements VideoServerModel { embedPath: string embedUrl: string - url?: string + url: string views: number likes: number diff --git a/client/src/app/shared/shared-share-modal/video-share.component.ts b/client/src/app/shared/shared-share-modal/video-share.component.ts index 341abdc2b..70890e551 100644 --- a/client/src/app/shared/shared-share-modal/video-share.component.ts +++ b/client/src/app/shared/shared-share-modal/video-share.component.ts @@ -96,12 +96,12 @@ export class VideoShareComponent { } getVideoUrl () { - const baseUrl = this.customizations.originUrl - ? this.video.originInstanceUrl - : window.location.origin + const url = this.customizations.originUrl + ? this.video.url + : buildVideoLink(this.video, window.location.origin) return decorateVideoLink({ - url: buildVideoLink(this.video, baseUrl), + url, ...this.getVideoOptions() }) -- cgit v1.2.3