@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 () {
import { deleteFileAsync, generateRandomString } from './utils'
import { extname } from 'path'
import { isArray } from './custom-validators/misc'
+import { UserModel } from '../models/account/user'
function buildNSFWFilter (res: express.Response, paramNSFW?: string) {
if (paramNSFW === 'true') return true
if (paramNSFW === 'both') return undefined
if (res.locals.oauth) {
- const user: User = res.locals.oauth.token.User
+ const user: UserModel = res.locals.oauth.token.User
// User does not want NSFW videos
if (user.nsfwPolicy === 'do_not_list') return false