From 0883b3245bf0deb9106c4041e9afbd3521b79280 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Apr 2018 11:01:34 +0200 Subject: Add ability to choose what policy we have for NSFW videos There is a global instance setting and a per user setting --- client/src/app/shared/users/user.model.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'client/src/app/shared/users') diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 4a94b032d..2bdc48a1d 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -1,5 +1,6 @@ import { hasUserRight, User as UserServerModel, UserRight, UserRole, VideoChannel } from '../../../../../shared' import { Account } from '../account/account.model' +import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' export type UserConstructorHash = { id: number, @@ -7,7 +8,7 @@ export type UserConstructorHash = { email: string, role: UserRole, videoQuota?: number, - displayNSFW?: boolean, + nsfwPolicy?: NSFWPolicyType, autoPlayVideo?: boolean, createdAt?: Date, account?: Account, @@ -18,7 +19,7 @@ export class User implements UserServerModel { username: string email: string role: UserRole - displayNSFW: boolean + nsfwPolicy: NSFWPolicyType autoPlayVideo: boolean videoQuota: number account: Account @@ -40,8 +41,8 @@ export class User implements UserServerModel { this.videoQuota = hash.videoQuota } - if (hash.displayNSFW !== undefined) { - this.displayNSFW = hash.displayNSFW + if (hash.nsfwPolicy !== undefined) { + this.nsfwPolicy = hash.nsfwPolicy } if (hash.autoPlayVideo !== undefined) { -- cgit v1.2.3