aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-19 14:55:58 +0200
committerChocobozzz <me@florianbigard.com>2019-06-19 15:05:36 +0200
commit3caf77d3b11f2dbc12e52d665183d36604c1dab9 (patch)
tree53e08727d5f1dc8be2bd4f4a14dadc05f607a9fb /server/models/account
parentbbe078ba55be635b5fc92f8f6286c45792b9e7e5 (diff)
downloadPeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.tar.gz
PeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.tar.zst
PeerTube-3caf77d3b11f2dbc12e52d665183d36604c1dab9.zip
Add language filters in user preferences
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/user.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index e75039521..aac691d66 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -31,6 +31,7 @@ import {
31 isUserPasswordValid, 31 isUserPasswordValid,
32 isUserRoleValid, 32 isUserRoleValid,
33 isUserUsernameValid, 33 isUserUsernameValid,
34 isUserVideoLanguages,
34 isUserVideoQuotaDailyValid, 35 isUserVideoQuotaDailyValid,
35 isUserVideoQuotaValid, 36 isUserVideoQuotaValid,
36 isUserVideosHistoryEnabledValid, 37 isUserVideosHistoryEnabledValid,
@@ -147,6 +148,12 @@ export class UserModel extends Model<UserModel> {
147 @Column 148 @Column
148 autoPlayVideo: boolean 149 autoPlayVideo: boolean
149 150
151 @AllowNull(true)
152 @Default(null)
153 @Is('UserVideoLanguages', value => throwIfNotValid(value, isUserVideoLanguages, 'video languages'))
154 @Column(DataType.ARRAY(DataType.STRING))
155 videoLanguages: string[]
156
150 @AllowNull(false) 157 @AllowNull(false)
151 @Default(UserAdminFlag.NONE) 158 @Default(UserAdminFlag.NONE)
152 @Is('UserAdminFlags', value => throwIfNotValid(value, isUserAdminFlagsValid, 'user admin flags')) 159 @Is('UserAdminFlags', value => throwIfNotValid(value, isUserAdminFlagsValid, 'user admin flags'))
@@ -551,6 +558,7 @@ export class UserModel extends Model<UserModel> {
551 webTorrentEnabled: this.webTorrentEnabled, 558 webTorrentEnabled: this.webTorrentEnabled,
552 videosHistoryEnabled: this.videosHistoryEnabled, 559 videosHistoryEnabled: this.videosHistoryEnabled,
553 autoPlayVideo: this.autoPlayVideo, 560 autoPlayVideo: this.autoPlayVideo,
561 videoLanguages: this.videoLanguages,
554 role: this.role, 562 role: this.role,
555 roleLabel: USER_ROLE_LABELS[ this.role ], 563 roleLabel: USER_ROLE_LABELS[ this.role ],
556 videoQuota: this.videoQuota, 564 videoQuota: this.videoQuota,