From e822fdaeee90cb7c70d5678f19249198cd7aae8c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Jun 2016 22:34:02 +0200 Subject: Use ng2-file-upload instead of jquery and add tags support to the video upload form --- server/initializers/constants.js | 4 ++-- server/middlewares/reqValidators/videos.js | 2 +- server/models/videos.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/initializers/constants.js b/server/initializers/constants.js index 6fa322010..22cbb1361 100644 --- a/server/initializers/constants.js +++ b/server/initializers/constants.js @@ -41,8 +41,8 @@ const THUMBNAILS_SIZE = '200x110' const THUMBNAILS_STATIC_PATH = '/static/thumbnails' const VIDEOS_CONSTRAINTS_FIELDS = { - NAME: { min: 1, max: 50 }, // Length - DESCRIPTION: { min: 1, max: 250 }, // Length + NAME: { min: 3, max: 50 }, // Length + DESCRIPTION: { min: 3, max: 250 }, // Length MAGNET_URI: { min: 10 }, // Length DURATION: { min: 1, max: 7200 }, // Number AUTHOR: { min: 3, max: 20 }, // Length diff --git a/server/middlewares/reqValidators/videos.js b/server/middlewares/reqValidators/videos.js index 3618e4716..f31fd93a2 100644 --- a/server/middlewares/reqValidators/videos.js +++ b/server/middlewares/reqValidators/videos.js @@ -32,7 +32,7 @@ function videosAdd (req, res, next) { } if (!customValidators.isVideoDurationValid(duration)) { - return res.status(400).send('Duration of the video file is too big (max: ' + constants.MAXIMUM_VIDEO_DURATION + 's).') + return res.status(400).send('Duration of the video file is too big (max: ' + constants.VIDEOS_CONSTRAINTS_FIELDS.DURATION.max + 's).') } videoFile.duration = duration diff --git a/server/models/videos.js b/server/models/videos.js index d6b743c7c..c177b414c 100644 --- a/server/models/videos.js +++ b/server/models/videos.js @@ -12,6 +12,7 @@ const port = config.get('webserver.port') // --------------------------------------------------------------------------- +// TODO: add indexes on searchable columns const videosSchema = mongoose.Schema({ name: String, namePath: String, -- cgit v1.2.3