]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-thumbnail / video-thumbnail.component.ts
index 67a9b0028ef2002b65f1ddff061722c3a5d80e8f..ad5d30db2aaf3ef088ff21bd6f5eb85db3de4c87 100644 (file)
@@ -12,7 +12,7 @@ export class VideoThumbnailComponent {
   @Input() video: Video
   @Input() nsfw = false
 
-  @Input() videoRouterLink: any[]
+  @Input() videoRouterLink: string | any[]
   @Input() queryParams: { [ p: string ]: any }
   @Input() videoHref: string
   @Input() videoTarget: string
@@ -31,6 +31,8 @@ export class VideoThumbnailComponent {
   }
 
   isLiveEnded () {
+    if (!this.video.state) return
+
     return this.video.state.id === VideoState.LIVE_ENDED
   }
 
@@ -55,7 +57,7 @@ export class VideoThumbnailComponent {
   getVideoRouterLink () {
     if (this.videoRouterLink) return this.videoRouterLink
 
-    return [ '/videos/watch', this.video.uuid ]
+    return Video.buildWatchUrl(this.video)
   }
 
   onWatchLaterClick (event: Event) {