]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-imports.ts
Downsample to the closest divisor standard framerate
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-imports.ts
index 8b0dd8960d77dac1ebf4e73ca6a964f0cf003b67..318dad10087b50e0fcaa25338aea8d2ed94bef21 100644 (file)
@@ -1,6 +1,6 @@
 import * as express from 'express'
-import { body } from 'express-validator/check'
-import { isIdValid } from '../../../helpers/custom-validators/misc'
+import { body } from 'express-validator'
+import { isIdValid, toIntOrNull } from '../../../helpers/custom-validators/misc'
 import { logger } from '../../../helpers/logger'
 import { areValidationErrors } from '../utils'
 import { getCommonVideoEditAttributes } from './videos'
@@ -13,7 +13,7 @@ import { doesVideoChannelOfAccountExist } from '../../../helpers/middlewares'
 
 const videoImportAddValidator = getCommonVideoEditAttributes().concat([
   body('channelId')
-    .toInt()
+    .customSanitizer(toIntOrNull)
     .custom(isIdValid).withMessage('Should have correct video channel id'),
   body('targetUrl')
     .optional()