aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-07-31 20:58:43 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-07-31 20:58:43 +0200
commite4c556196d7b31111f17596840d2e1d60caa7dcb (patch)
tree41be84f002600aa0153ac09cc5d79fdd90d126e3 /server/middlewares/validators/videos.js
parente62f6ef741c8d14817e321c554796ad64ea7ae1b (diff)
downloadPeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.tar.gz
PeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.tar.zst
PeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.zip
Server: reorganize express validators
Diffstat (limited to 'server/middlewares/validators/videos.js')
-rw-r--r--server/middlewares/validators/videos.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js
index 3e2af06fb..422f3642f 100644
--- a/server/middlewares/validators/videos.js
+++ b/server/middlewares/validators/videos.js
@@ -4,7 +4,7 @@ const mongoose = require('mongoose')
4 4
5const checkErrors = require('./utils').checkErrors 5const checkErrors = require('./utils').checkErrors
6const constants = require('../../initializers/constants') 6const constants = require('../../initializers/constants')
7const customValidators = require('../../helpers/custom-validators') 7const customVideosValidators = require('../../helpers/custom-validators').videos
8const logger = require('../../helpers/logger') 8const logger = require('../../helpers/logger')
9 9
10const Video = mongoose.model('Video') 10const Video = mongoose.model('Video')
@@ -33,8 +33,8 @@ function videosAdd (req, res, next) {
33 return res.status(400).send('Cannot retrieve metadata of the file.') 33 return res.status(400).send('Cannot retrieve metadata of the file.')
34 } 34 }
35 35
36 if (!customValidators.isVideoDurationValid(duration)) { 36 if (!customVideosValidators.isVideoDurationValid(duration)) {
37 return res.status(400).send('Duration of the video file is too big (max: ' + constants.VIDEOS_CONSTRAINTS_FIELDS.DURATION.max + 's).') 37 return res.status(400).send('Duration of the video file is too big (max: ' + constants.CONSTRAINTS_FIELDS.VIDEOS.DURATION.max + 's).')
38 } 38 }
39 39
40 videoFile.duration = duration 40 videoFile.duration = duration