diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-28 17:30:59 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-29 14:56:35 +0200 |
commit | d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb (patch) | |
tree | a4cb07318100031951c3dffc61f4f2cb95d2cbd0 /client/src/app/shared/shared-main/video | |
parent | 62ddc31a9e4b92d7d27898ccfc363f68ab044139 (diff) | |
download | PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.gz PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.zst PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.zip |
Support short uuid for GET video/playlist
Diffstat (limited to 'client/src/app/shared/shared-main/video')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.model.ts | 15 |
1 files changed, 13 insertions, 2 deletions
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 ab8ed9051..f0a4a3f37 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts | |||
@@ -26,12 +26,18 @@ export class Video implements VideoServerModel { | |||
26 | licence: VideoConstant<number> | 26 | licence: VideoConstant<number> |
27 | language: VideoConstant<string> | 27 | language: VideoConstant<string> |
28 | privacy: VideoConstant<VideoPrivacy> | 28 | privacy: VideoConstant<VideoPrivacy> |
29 | |||
29 | description: string | 30 | description: string |
31 | |||
30 | duration: number | 32 | duration: number |
31 | durationLabel: string | 33 | durationLabel: string |
34 | |||
32 | id: number | 35 | id: number |
33 | uuid: string | 36 | uuid: string |
37 | shortUUID: string | ||
38 | |||
34 | isLocal: boolean | 39 | isLocal: boolean |
40 | |||
35 | name: string | 41 | name: string |
36 | serverHost: string | 42 | serverHost: string |
37 | thumbnailPath: string | 43 | thumbnailPath: string |
@@ -85,8 +91,12 @@ export class Video implements VideoServerModel { | |||
85 | 91 | ||
86 | pluginData?: any | 92 | pluginData?: any |
87 | 93 | ||
88 | static buildClientUrl (videoUUID: string) { | 94 | static buildWatchUrl (video: Partial<Pick<Video, 'uuid' | 'shortUUID'>>) { |
89 | return '/w/' + videoUUID | 95 | return '/w/' + (video.shortUUID || video.uuid) |
96 | } | ||
97 | |||
98 | static buildUpdateUrl (video: Pick<Video, 'uuid'>) { | ||
99 | return '/videos/update/' + video.uuid | ||
90 | } | 100 | } |
91 | 101 | ||
92 | constructor (hash: VideoServerModel, translations = {}) { | 102 | constructor (hash: VideoServerModel, translations = {}) { |
@@ -109,6 +119,7 @@ export class Video implements VideoServerModel { | |||
109 | 119 | ||
110 | this.id = hash.id | 120 | this.id = hash.id |
111 | this.uuid = hash.uuid | 121 | this.uuid = hash.uuid |
122 | this.shortUUID = hash.shortUUID | ||
112 | 123 | ||
113 | this.isLocal = hash.isLocal | 124 | this.isLocal = hash.isLocal |
114 | this.name = hash.name | 125 | this.name = hash.name |