]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-thumbnail / video-thumbnail.component.ts
index 812c7a50880110dbdcf02533c88781e0befcec4c..bdede17a3d448bc13651b28cdbd6fc1a9b95754c 100644 (file)
@@ -1,6 +1,6 @@
 import { Component, EventEmitter, Input, Output } from '@angular/core'
 import { ScreenService } from '@app/core'
-import { I18n } from '@ngx-translate/i18n-polyfill'
+import { VideoState } from '@shared/models'
 import { Video } from '../shared-main'
 
 @Component({
@@ -25,12 +25,15 @@ export class VideoThumbnailComponent {
   addToWatchLaterText: string
   addedToWatchLaterText: string
 
-  constructor (
-    private screenService: ScreenService,
-    private i18n: I18n
-  ) {
-    this.addToWatchLaterText = this.i18n('Add to watch later')
-    this.addedToWatchLaterText = this.i18n('Remove from watch later')
+  constructor (private screenService: ScreenService) {
+    this.addToWatchLaterText = $localize`Add to watch later`
+    this.addedToWatchLaterText = $localize`Remove from watch later`
+  }
+
+  isLiveEnded () {
+    if (!this.video.state) return
+
+    return this.video.state.id === VideoState.LIVE_ENDED
   }
 
   getImageUrl () {