diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-17 10:48:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-17 10:48:56 +0200 |
commit | bb5d90e62f631af3c899fbe586485e64938a5927 (patch) | |
tree | 8dc28c7027a52bed76bcc7e117da290ff7a58b6b /server/models/account/user.ts | |
parent | bcf21a376f1e26cb3e74236e4cc41909310d4c32 (diff) | |
parent | a73115f31ae891cb47759f075b1d2cead40817a4 (diff) | |
download | PeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.tar.gz PeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.tar.zst PeerTube-bb5d90e62f631af3c899fbe586485e64938a5927.zip |
Merge branch 'feature/webtorrent-disabling' into develop
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 ], |