diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:04:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:37:51 +0200 |
commit | 2186386cca113506791583cb07d6ccacba7af4e0 (patch) | |
tree | 3c214c0b5fbd64332624267fa6e51fd4a9cf6474 /server/middlewares/validators/videos.ts | |
parent | 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (diff) | |
download | PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.gz PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.zst PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.zip |
Add concept of video state, and add ability to wait transcoding before
publishing a video
Diffstat (limited to 'server/middlewares/validators/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts index c5c45fe58..e181aebdb 100644 --- a/server/middlewares/validators/videos.ts +++ b/server/middlewares/validators/videos.ts | |||
@@ -55,8 +55,13 @@ const videosAddValidator = [ | |||
55 | .customSanitizer(toValueOrNull) | 55 | .customSanitizer(toValueOrNull) |
56 | .custom(isVideoLanguageValid).withMessage('Should have a valid language'), | 56 | .custom(isVideoLanguageValid).withMessage('Should have a valid language'), |
57 | body('nsfw') | 57 | body('nsfw') |
58 | .optional() | ||
58 | .toBoolean() | 59 | .toBoolean() |
59 | .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), | 60 | .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), |
61 | body('waitTranscoding') | ||
62 | .optional() | ||
63 | .toBoolean() | ||
64 | .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'), | ||
60 | body('description') | 65 | body('description') |
61 | .optional() | 66 | .optional() |
62 | .customSanitizer(toValueOrNull) | 67 | .customSanitizer(toValueOrNull) |
@@ -70,6 +75,7 @@ const videosAddValidator = [ | |||
70 | .customSanitizer(toValueOrNull) | 75 | .customSanitizer(toValueOrNull) |
71 | .custom(isVideoTagsValid).withMessage('Should have correct tags'), | 76 | .custom(isVideoTagsValid).withMessage('Should have correct tags'), |
72 | body('commentsEnabled') | 77 | body('commentsEnabled') |
78 | .optional() | ||
73 | .toBoolean() | 79 | .toBoolean() |
74 | .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), | 80 | .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), |
75 | body('privacy') | 81 | body('privacy') |
@@ -149,6 +155,10 @@ const videosUpdateValidator = [ | |||
149 | .optional() | 155 | .optional() |
150 | .toBoolean() | 156 | .toBoolean() |
151 | .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), | 157 | .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), |
158 | body('waitTranscoding') | ||
159 | .optional() | ||
160 | .toBoolean() | ||
161 | .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'), | ||
152 | body('privacy') | 162 | body('privacy') |
153 | .optional() | 163 | .optional() |
154 | .toInt() | 164 | .toInt() |