X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideos.ts;h=159727e2856d11dea05aa172e414ac27ae30f56e;hb=b718fd22374d64534bcfe69932cf562894abed6a;hp=d9626929c649c96e88d30e2f1c4d8e428b6c143d;hpb=501e961199578129629cf0567033d13efced9904;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index d9626929c..159727e28 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -14,6 +14,7 @@ import { } from '../../../helpers/custom-validators/misc' import { checkUserCanManageVideo, + isVideoOriginallyPublishedAtValid, isScheduleVideoUpdatePrivacyValid, isVideoCategoryValid, isVideoChannelOfAccountExist, @@ -344,7 +345,10 @@ function getCommonVideoAttributes () { .optional() .toBoolean() .custom(isBooleanValid).withMessage('Should have downloading enabled boolean'), - + body('originallyPublishedAt') + .optional() + .customSanitizer(toValueOrNull) + .custom(isVideoOriginallyPublishedAtValid).withMessage('Should have a valid original publication date'), body('scheduleUpdate') .optional() .customSanitizer(toValueOrNull),