diff options
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r-- | server/models/account/user.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 39654cfcf..4b4a562fa 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -31,7 +31,8 @@ import { | |||
31 | isUserRoleValid, | 31 | isUserRoleValid, |
32 | isUserUsernameValid, | 32 | isUserUsernameValid, |
33 | isUserVideoQuotaDailyValid, | 33 | isUserVideoQuotaDailyValid, |
34 | isUserVideoQuotaValid | 34 | isUserVideoQuotaValid, |
35 | isUserWebTorrentEnabledValid | ||
35 | } from '../../helpers/custom-validators/users' | 36 | } from '../../helpers/custom-validators/users' |
36 | import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto' | 37 | import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto' |
37 | import { OAuthTokenModel } from '../oauth/oauth-token' | 38 | import { OAuthTokenModel } from '../oauth/oauth-token' |
@@ -108,6 +109,11 @@ export class UserModel extends Model<UserModel> { | |||
108 | nsfwPolicy: NSFWPolicyType | 109 | nsfwPolicy: NSFWPolicyType |
109 | 110 | ||
110 | @AllowNull(false) | 111 | @AllowNull(false) |
112 | @Is('UserWebTorrentEnabled', value => throwIfNotValid(value, isUserWebTorrentEnabledValid, 'WebTorrent enabled')) | ||
113 | @Column | ||
114 | webTorrentEnabled: boolean | ||
115 | |||
116 | @AllowNull(false) | ||
111 | @Default(true) | 117 | @Default(true) |
112 | @Is('UserAutoPlayVideo', value => throwIfNotValid(value, isUserAutoPlayVideoValid, 'auto play video boolean')) | 118 | @Is('UserAutoPlayVideo', value => throwIfNotValid(value, isUserAutoPlayVideoValid, 'auto play video boolean')) |
113 | @Column | 119 | @Column |
@@ -355,6 +361,7 @@ export class UserModel extends Model<UserModel> { | |||
355 | email: this.email, | 361 | email: this.email, |
356 | emailVerified: this.emailVerified, | 362 | emailVerified: this.emailVerified, |
357 | nsfwPolicy: this.nsfwPolicy, | 363 | nsfwPolicy: this.nsfwPolicy, |
364 | webTorrentEnabled: this.webTorrentEnabled, | ||
358 | autoPlayVideo: this.autoPlayVideo, | 365 | autoPlayVideo: this.autoPlayVideo, |
359 | role: this.role, | 366 | role: this.role, |
360 | roleLabel: USER_ROLE_LABELS[ this.role ], | 367 | roleLabel: USER_ROLE_LABELS[ this.role ], |