import { User } from '../users'
import { Video } from './video.model'
import { ServerService } from '@app/core'
+import { VideoPrivacy } from '../../../../../shared'
export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto'
@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
} else {
this.ownerDisplayTypeChosen = 'videoChannel'
}
-
- this.isVideoBlur = this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())
}
displayOwnerAccount () {
displayOwnerVideoChannel () {
return this.ownerDisplayTypeChosen === 'videoChannel'
}
+
+ isUnlistedVideo () {
+ return this.video.privacy.id === VideoPrivacy.UNLISTED
+ }
+
+ isPrivateVideo () {
+ return this.video.privacy.id === VideoPrivacy.PRIVATE
+ }
}