X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fvideo-miniature.component.ts;h=2f951a1f1b3ecb25eeb7d1d84901b31922b9f4fc;hb=092092969633bbcf6d4891a083ea497a7d5c3154;hp=27098f4b4a0c097c5987572328d7b8dab1e5d7bb;hpb=0491173a61aed66205c017e0d7e0503ea316c144;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/video/video-miniature.component.ts index 27098f4b4..2f951a1f1 100644 --- a/client/src/app/shared/video/video-miniature.component.ts +++ b/client/src/app/shared/video/video-miniature.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core import { User } from '../users' import { Video } from './video.model' import { ServerService } from '@app/core' +import { VideoPrivacy } from '../../../../../shared' export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto' @@ -16,12 +17,14 @@ export class VideoMiniatureComponent implements OnInit { @Input() video: Video @Input() ownerDisplayType: OwnerDisplayType = 'account' - isVideoBlur: boolean - private ownerDisplayTypeChosen: 'account' | 'videoChannel' constructor (private serverService: ServerService) { } + get isVideoBlur () { + return this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig()) + } + ngOnInit () { if (this.ownerDisplayType === 'account' || this.ownerDisplayType === 'videoChannel') { this.ownerDisplayTypeChosen = this.ownerDisplayType @@ -38,8 +41,6 @@ export class VideoMiniatureComponent implements OnInit { } else { this.ownerDisplayTypeChosen = 'videoChannel' } - - this.isVideoBlur = this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig()) } displayOwnerAccount () { @@ -49,4 +50,12 @@ export class VideoMiniatureComponent implements OnInit { displayOwnerVideoChannel () { return this.ownerDisplayTypeChosen === 'videoChannel' } + + isUnlistedVideo () { + return this.video.privacy.id === VideoPrivacy.UNLISTED + } + + isPrivateVideo () { + return this.video.privacy.id === VideoPrivacy.PRIVATE + } }