diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-07-31 20:58:43 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-07-31 20:58:43 +0200 |
commit | e4c556196d7b31111f17596840d2e1d60caa7dcb (patch) | |
tree | 41be84f002600aa0153ac09cc5d79fdd90d126e3 /server/middlewares | |
parent | e62f6ef741c8d14817e321c554796ad64ea7ae1b (diff) | |
download | PeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.tar.gz PeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.tar.zst PeerTube-e4c556196d7b31111f17596840d2e1d60caa7dcb.zip |
Server: reorganize express validators
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/videos.js | 6 |
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 | ||
5 | const checkErrors = require('./utils').checkErrors | 5 | const checkErrors = require('./utils').checkErrors |
6 | const constants = require('../../initializers/constants') | 6 | const constants = require('../../initializers/constants') |
7 | const customValidators = require('../../helpers/custom-validators') | 7 | const customVideosValidators = require('../../helpers/custom-validators').videos |
8 | const logger = require('../../helpers/logger') | 8 | const logger = require('../../helpers/logger') |
9 | 9 | ||
10 | const Video = mongoose.model('Video') | 10 | const 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 |