X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-thumbnail%2Fvideo-thumbnail.component.ts;h=bdede17a3d448bc13651b28cdbd6fc1a9b95754c;hb=60c35932f6a14cfe83bb0e54407427cce70171ea;hp=3ff45d9b77f4dbddf3a1e9c119163ac44f232cd4;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts index 3ff45d9b7..bdede17a3 100644 --- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts @@ -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({ @@ -11,8 +11,11 @@ import { Video } from '../shared-main' export class VideoThumbnailComponent { @Input() video: Video @Input() nsfw = false - @Input() routerLink: any[] + + @Input() videoRouterLink: any[] @Input() queryParams: { [ p: string ]: any } + @Input() videoHref: string + @Input() videoTarget: string @Input() displayWatchLaterPlaylist: boolean @Input() inWatchLaterPlaylist: boolean @@ -22,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 () { @@ -49,7 +55,7 @@ export class VideoThumbnailComponent { } getVideoRouterLink () { - if (this.routerLink) return this.routerLink + if (this.videoRouterLink) return this.videoRouterLink return [ '/videos/watch', this.video.uuid ] }