]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/video/video.model.ts
Fix video update redirection id
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video.model.ts
index f0a4a3f37c031a9a7b33797d31ed2209e1750ec5..7471a933b2006e3a6e9a8b22534b0f24752b606d 100644 (file)
@@ -2,6 +2,7 @@ import { AuthUser } from '@app/core'
 import { User } from '@app/core/users/user.model'
 import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers'
 import { Actor } from '@app/shared/shared-main/account/actor.model'
+import { buildVideoWatchPath } from '@shared/core-utils'
 import { peertubeTranslate } from '@shared/core-utils/i18n'
 import {
   ActorImage,
@@ -92,14 +93,14 @@ export class Video implements VideoServerModel {
   pluginData?: any
 
   static buildWatchUrl (video: Partial<Pick<Video, 'uuid' | 'shortUUID'>>) {
-    return '/w/' + (video.shortUUID || video.uuid)
+    return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid })
   }
 
   static buildUpdateUrl (video: Pick<Video, 'uuid'>) {
     return '/videos/update/' + video.uuid
   }
 
-  constructor (hash: VideoServerModel, translations = {}) {
+  constructor (hash: VideoServerModel, translations: { [ id: string ]: string } = {}) {
     const absoluteAPIUrl = getAbsoluteAPIUrl()
 
     this.createdAt = new Date(hash.createdAt.toString())