aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r--server/models/account/user.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 26f04dcb5..70ed61e07 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -20,7 +20,7 @@ import {
20} from '../../helpers' 20} from '../../helpers'
21import { 21import {
22 isUserDisplayNSFWValid, isUserPasswordValid, isUserRoleValid, isUserUsernameValid, 22 isUserDisplayNSFWValid, isUserPasswordValid, isUserRoleValid, isUserUsernameValid,
23 isUserVideoQuotaValid 23 isUserVideoQuotaValid, isUserAutoPlayVideoValid
24} from '../../helpers/custom-validators/users' 24} from '../../helpers/custom-validators/users'
25import { OAuthTokenModel } from '../oauth/oauth-token' 25import { OAuthTokenModel } from '../oauth/oauth-token'
26import { getSort, throwIfNotValid } from '../utils' 26import { getSort, throwIfNotValid } from '../utils'
@@ -83,6 +83,12 @@ export class UserModel extends Model<UserModel> {
83 displayNSFW: boolean 83 displayNSFW: boolean
84 84
85 @AllowNull(false) 85 @AllowNull(false)
86 @Default(true)
87 @Is('UserAutoPlayVideo', value => throwIfNotValid(value, isUserAutoPlayVideoValid, 'auto play video boolean'))
88 @Column
89 autoPlayVideo: boolean
90
91 @AllowNull(false)
86 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role')) 92 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role'))
87 @Column 93 @Column
88 role: number 94 role: number
@@ -223,6 +229,7 @@ export class UserModel extends Model<UserModel> {
223 username: this.username, 229 username: this.username,
224 email: this.email, 230 email: this.email,
225 displayNSFW: this.displayNSFW, 231 displayNSFW: this.displayNSFW,
232 autoPlayVideo: this.autoPlayVideo,
226 role: this.role, 233 role: this.role,
227 roleLabel: USER_ROLE_LABELS[ this.role ], 234 roleLabel: USER_ROLE_LABELS[ this.role ],
228 videoQuota: this.videoQuota, 235 videoQuota: this.videoQuota,