diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 11:52:52 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 11:53:13 +0100 |
commit | fd45e8f43c2638478599ca75632518054461da85 (patch) | |
tree | 01e1fb5ddad53bde8fb2c48f348fb8add51cfdb3 /server/helpers | |
parent | b7a485121d71c95fcf5e432e4cc745cf91af4f93 (diff) | |
download | PeerTube-fd45e8f43c2638478599ca75632518054461da85.tar.gz PeerTube-fd45e8f43c2638478599ca75632518054461da85.tar.zst PeerTube-fd45e8f43c2638478599ca75632518054461da85.zip |
Add video privacy setting
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 5b9102275..f3fdcaf2d 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | VIDEO_LICENCES, | 11 | VIDEO_LICENCES, |
12 | VIDEO_LANGUAGES, | 12 | VIDEO_LANGUAGES, |
13 | VIDEO_RATE_TYPES, | 13 | VIDEO_RATE_TYPES, |
14 | VIDEO_PRIVACIES, | ||
14 | database as db | 15 | database as db |
15 | } from '../../initializers' | 16 | } from '../../initializers' |
16 | import { isUserUsernameValid } from './users' | 17 | import { isUserUsernameValid } from './users' |
@@ -36,6 +37,15 @@ function isVideoLicenceValid (value: number) { | |||
36 | return VIDEO_LICENCES[value] !== undefined | 37 | return VIDEO_LICENCES[value] !== undefined |
37 | } | 38 | } |
38 | 39 | ||
40 | function isVideoPrivacyValid (value: string) { | ||
41 | return VIDEO_PRIVACIES[value] !== undefined | ||
42 | } | ||
43 | |||
44 | // Maybe we don't know the remote privacy setting, but that doesn't matter | ||
45 | function isRemoteVideoPrivacyValid (value: string) { | ||
46 | return validator.isInt('' + value) | ||
47 | } | ||
48 | |||
39 | // Maybe we don't know the remote licence, but that doesn't matter | 49 | // Maybe we don't know the remote licence, but that doesn't matter |
40 | function isRemoteVideoLicenceValid (value: string) { | 50 | function isRemoteVideoLicenceValid (value: string) { |
41 | return validator.isInt('' + value) | 51 | return validator.isInt('' + value) |
@@ -195,6 +205,8 @@ export { | |||
195 | isVideoDislikesValid, | 205 | isVideoDislikesValid, |
196 | isVideoEventCountValid, | 206 | isVideoEventCountValid, |
197 | isVideoFileSizeValid, | 207 | isVideoFileSizeValid, |
208 | isVideoPrivacyValid, | ||
209 | isRemoteVideoPrivacyValid, | ||
198 | isVideoFileResolutionValid, | 210 | isVideoFileResolutionValid, |
199 | checkVideoExists, | 211 | checkVideoExists, |
200 | isRemoteVideoCategoryValid, | 212 | isRemoteVideoCategoryValid, |