diff options
Diffstat (limited to 'client/src/app/shared/shared-video-playlist')
3 files changed, 10 insertions, 2 deletions
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 57eab4dfd..d99170e4e 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 | |||
@@ -66,7 +66,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
66 | buildRouterLink () { | 66 | buildRouterLink () { |
67 | if (!this.playlist) return null | 67 | if (!this.playlist) return null |
68 | 68 | ||
69 | return [ '/w/p', this.playlist.uuid ] | 69 | return VideoPlaylist.buildWatchUrl(this.playlist) |
70 | } | 70 | } |
71 | 71 | ||
72 | buildRouterQuery () { | 72 | 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 8de5092a9..c80ea2e6b 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 | |||
@@ -39,7 +39,7 @@ export class VideoPlaylistMiniatureComponent implements OnInit { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | if (this.linkType === 'internal' || !this.playlist.url) { | 41 | if (this.linkType === 'internal' || !this.playlist.url) { |
42 | this.routerLink = [ '/w/p', this.playlist.uuid ] | 42 | this.routerLink = VideoPlaylist.buildWatchUrl(this.playlist) |
43 | return | 43 | return |
44 | } | 44 | } |
45 | 45 | ||
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts index d67f372f4..d96b70922 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts | |||
@@ -13,6 +13,8 @@ import { | |||
13 | export class VideoPlaylist implements ServerVideoPlaylist { | 13 | export class VideoPlaylist implements ServerVideoPlaylist { |
14 | id: number | 14 | id: number |
15 | uuid: string | 15 | uuid: string |
16 | shortUUID: string | ||
17 | |||
16 | isLocal: boolean | 18 | isLocal: boolean |
17 | 19 | ||
18 | url: string | 20 | url: string |
@@ -41,11 +43,17 @@ export class VideoPlaylist implements ServerVideoPlaylist { | |||
41 | 43 | ||
42 | videoChannelBy?: string | 44 | videoChannelBy?: string |
43 | 45 | ||
46 | static buildWatchUrl (playlist: Pick<VideoPlaylist, 'uuid' | 'shortUUID'>) { | ||
47 | return '/w/p/' + (playlist.uuid || playlist.shortUUID) | ||
48 | } | ||
49 | |||
44 | constructor (hash: ServerVideoPlaylist, translations: {}) { | 50 | constructor (hash: ServerVideoPlaylist, translations: {}) { |
45 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 51 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
46 | 52 | ||
47 | this.id = hash.id | 53 | this.id = hash.id |
48 | this.uuid = hash.uuid | 54 | this.uuid = hash.uuid |
55 | this.shortUUID = hash.shortUUID | ||
56 | |||
49 | this.url = hash.url | 57 | this.url = hash.url |
50 | this.isLocal = hash.isLocal | 58 | this.isLocal = hash.isLocal |
51 | 59 | ||