aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-25 17:28:45 +0200
committerChocobozzz <me@florianbigard.com>2019-07-25 17:28:45 +0200
commit2b65c4e53511ccb85b17479cb1c62717afb8511c (patch)
tree1dd9ecd1803023fa66152c4746c6050e57adceaa /server/helpers/custom-validators/videos.ts
parent552d95b1e69fbbd99f5bc300a127457e1b97b9df (diff)
downloadPeerTube-2b65c4e53511ccb85b17479cb1c62717afb8511c.tar.gz
PeerTube-2b65c4e53511ccb85b17479cb1c62717afb8511c.tar.zst
PeerTube-2b65c4e53511ccb85b17479cb1c62717afb8511c.zip
Fix scheduled privacy and verify email validations
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r--server/helpers/custom-validators/videos.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 9ab1ef234..e92ef9b92 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -98,15 +98,11 @@ function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } |
98} 98}
99 99
100function isVideoPrivacyValid (value: number) { 100function isVideoPrivacyValid (value: number) {
101 return validator.isInt(value + '') && VIDEO_PRIVACIES[ value ] !== undefined 101 return VIDEO_PRIVACIES[ value ] !== undefined
102} 102}
103 103
104function isScheduleVideoUpdatePrivacyValid (value: number) { 104function isScheduleVideoUpdatePrivacyValid (value: number) {
105 return validator.isInt(value + '') && 105 return value === VideoPrivacy.UNLISTED || value === VideoPrivacy.PUBLIC
106 (
107 value === VideoPrivacy.UNLISTED ||
108 value === VideoPrivacy.PUBLIC
109 )
110} 106}
111 107
112function isVideoOriginallyPublishedAtValid (value: string | null) { 108function isVideoOriginallyPublishedAtValid (value: string | null) {