From a1eda903a497857017495f37a1fd3593ba7ab23c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 May 2021 11:36:33 +0200 Subject: Support '/w/' and '/w/p/' for watch page And use them as default in client --- client/src/app/shared/shared-main/users/user-notification.model.ts | 2 +- client/src/app/shared/shared-main/video/video.model.ts | 2 +- client/src/app/shared/shared-share-modal/video-share.component.ts | 4 ++-- client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts | 2 +- client/src/app/shared/shared-video-comment/video-comment.model.ts | 2 +- .../app/shared/shared-video-miniature/video-miniature.component.ts | 2 +- .../video-playlist-element-miniature.component.ts | 2 +- .../shared-video-playlist/video-playlist-miniature.component.ts | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts index 002a01583..c80bc13b0 100644 --- a/client/src/app/shared/shared-main/users/user-notification.model.ts +++ b/client/src/app/shared/shared-main/users/user-notification.model.ts @@ -238,7 +238,7 @@ export class UserNotification implements UserNotificationServer { } private buildVideoUrl (video: { uuid: string }) { - return '/videos/watch/' + video.uuid + return '/w/' + video.uuid } private buildAccountUrl (account: { name: string, host: string }) { 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 526d10e32..e7f739bfe 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -88,7 +88,7 @@ export class Video implements VideoServerModel { pluginData?: any static buildClientUrl (videoUUID: string) { - return '/videos/watch/' + videoUUID + return '/w/' + videoUUID } constructor (hash: VideoServerModel, translations = {}) { 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 e8760bfcc..2a73e6166 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 @@ -98,14 +98,14 @@ export class VideoShareComponent { getVideoUrl () { let baseUrl = this.customizations.originUrl ? this.video.originInstanceUrl : window.location.origin - baseUrl += '/videos/watch/' + this.video.uuid + baseUrl += '/w/' + this.video.uuid const options = this.getVideoOptions(baseUrl) return buildVideoLink(options) } getPlaylistUrl () { - const base = window.location.origin + '/videos/watch/playlist/' + this.playlist.uuid + const base = window.location.origin + '/w/p/' + this.playlist.uuid if (!this.includeVideoInPlaylist) return base diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts index bdede17a3..d5583c29f 100644 --- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts @@ -57,7 +57,7 @@ export class VideoThumbnailComponent { getVideoRouterLink () { if (this.videoRouterLink) return this.videoRouterLink - return [ '/videos/watch', this.video.uuid ] + return [ '/w', this.video.uuid ] } onWatchLaterClick (event: Event) { diff --git a/client/src/app/shared/shared-video-comment/video-comment.model.ts b/client/src/app/shared/shared-video-comment/video-comment.model.ts index 1a2fe03db..94d6c5fa8 100644 --- a/client/src/app/shared/shared-video-comment/video-comment.model.ts +++ b/client/src/app/shared/shared-video-comment/video-comment.model.ts @@ -85,7 +85,7 @@ export class VideoCommentAdmin implements VideoCommentAdminServerModel { id: hash.video.id, uuid: hash.video.uuid, name: hash.video.name, - localUrl: '/videos/watch/' + hash.video.uuid + localUrl: '/w/' + hash.video.uuid } this.localUrl = this.video.localUrl + ';threadId=' + this.threadId diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index b58c118be..aac55a6e9 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts @@ -125,7 +125,7 @@ export class VideoMiniatureComponent implements OnInit { buildVideoLink () { if (this.videoLinkType === 'internal' || !this.video.url) { - this.videoRouterLink = [ '/videos/watch', this.video.uuid ] + this.videoRouterLink = [ '/w', this.video.uuid ] return } diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index 7c083ae26..86c281a1e 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts @@ -71,7 +71,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { buildRouterLink () { if (!this.playlist) return null - return [ '/videos/watch/playlist', this.playlist.uuid ] + return [ '/w/p', this.playlist.uuid ] } buildRouterQuery () { diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts index 6b0b1056f..9bbec6038 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts @@ -18,6 +18,6 @@ export class VideoPlaylistMiniatureComponent { if (this.toManage) return [ '/my-library/video-playlists', this.playlist.uuid ] if (this.playlist.videosLength === 0) return null - return [ '/videos/watch/playlist', this.playlist.uuid ] + return [ '/w/p', this.playlist.uuid ] } } -- cgit v1.2.3