]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/videos.ts
Merge branch 'develop' into pr/1285
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / videos.ts
index 194d12c6e5668d242f5fcd781ff9cf810356d0c4..159727e2856d11dea05aa172e414ac27ae30f56e 100644 (file)
@@ -341,11 +341,14 @@ function getCommonVideoAttributes () {
       .optional()
       .toBoolean()
       .custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
-    body('originallyPublishedAt')
+    body('downloadEnabled')
       .optional()
-      .customSanitizer(toValueOrNull)
-      .custom(isVideoOriginallyPublishedAtValid).withMessage('Should have a valid original publication date'),
-
+      .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),