aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/customValidators.js4
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
3const validator = require('validator') 3const validator = require('validator')
4 4
5const constants = require('../initializers/constants')
6
5const customValidators = { 7const 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}