aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/helpers/customValidators.js1
-rw-r--r--server/initializers/constants.js3
2 files changed, 4 insertions, 0 deletions
diff --git a/server/helpers/customValidators.js b/server/helpers/customValidators.js
index 9b982369e..b95e2b9bb 100644
--- a/server/helpers/customValidators.js
+++ b/server/helpers/customValidators.js
@@ -19,6 +19,7 @@ function eachIsRemoteVideosAddValid (values) {
19 !isNaN(val.duration) && 19 !isNaN(val.duration) &&
20 val.duration >= 0 && 20 val.duration >= 0 &&
21 val.duration < constants.MAXIMUM_VIDEO_DURATION && 21 val.duration < constants.MAXIMUM_VIDEO_DURATION &&
22 validator.isLength(val.author, 1, constants.MAXIMUM_AUTHOR_LENGTH) &&
22 validator.isDate(val.createdDate) 23 validator.isDate(val.createdDate)
23 }) 24 })
24} 25}
diff --git a/server/initializers/constants.js b/server/initializers/constants.js
index d87a376d3..78bee5efe 100644
--- a/server/initializers/constants.js
+++ b/server/initializers/constants.js
@@ -9,6 +9,8 @@ let FRIEND_BASE_SCORE = 100
9// Time to wait between requests to the friends 9// Time to wait between requests to the friends
10let INTERVAL = 60000 10let INTERVAL = 60000
11 11
12// Max length of the author username
13const MAXIMUM_AUTHOR_LENGTH = 20
12// 2 hours maximum for the duration of a video (in seconds) 14// 2 hours maximum for the duration of a video (in seconds)
13let MAXIMUM_VIDEO_DURATION = 7200 15let MAXIMUM_VIDEO_DURATION = 7200
14 16
@@ -44,6 +46,7 @@ module.exports = {
44 API_VERSION: API_VERSION, 46 API_VERSION: API_VERSION,
45 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE, 47 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,
46 INTERVAL: INTERVAL, 48 INTERVAL: INTERVAL,
49 MAXIMUM_AUTHOR_LENGTH: MAXIMUM_AUTHOR_LENGTH,
47 MAXIMUM_VIDEO_DURATION: MAXIMUM_VIDEO_DURATION, 50 MAXIMUM_VIDEO_DURATION: MAXIMUM_VIDEO_DURATION,
48 PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT, 51 PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT,
49 PODS_SCORE: PODS_SCORE, 52 PODS_SCORE: PODS_SCORE,