diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/customValidators.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/helpers/customValidators.js b/server/helpers/customValidators.js index a8fc6942d..9b982369e 100644 --- a/server/helpers/customValidators.js +++ b/server/helpers/customValidators.js | |||
@@ -2,6 +2,8 @@ | |||
2 | 2 | ||
3 | const validator = require('validator') | 3 | const validator = require('validator') |
4 | 4 | ||
5 | const constants = require('../initializers/constants') | ||
6 | |||
5 | const customValidators = { | 7 | const customValidators = { |
6 | eachIsRemoteVideosAddValid: eachIsRemoteVideosAddValid, | 8 | eachIsRemoteVideosAddValid: eachIsRemoteVideosAddValid, |
7 | eachIsRemoteVideosRemoveValid: eachIsRemoteVideosRemoveValid, | 9 | eachIsRemoteVideosRemoveValid: eachIsRemoteVideosRemoveValid, |
@@ -15,6 +17,8 @@ function eachIsRemoteVideosAddValid (values) { | |||
15 | validator.isLength(val.magnetUri, 10) && | 17 | validator.isLength(val.magnetUri, 10) && |
16 | validator.isURL(val.podUrl) && | 18 | validator.isURL(val.podUrl) && |
17 | !isNaN(val.duration) && | 19 | !isNaN(val.duration) && |
20 | val.duration >= 0 && | ||
21 | val.duration < constants.MAXIMUM_VIDEO_DURATION && | ||
18 | validator.isDate(val.createdDate) | 22 | validator.isDate(val.createdDate) |
19 | }) | 23 | }) |
20 | } | 24 | } |