diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-06-07 22:34:02 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-06-07 22:34:02 +0200 |
commit | e822fdaeee90cb7c70d5678f19249198cd7aae8c (patch) | |
tree | 07678eff3b3d378bda40800002b515b982017c78 /server | |
parent | 8c255eb53c8f47bd64778d6fbcb93b248ee14163 (diff) | |
download | PeerTube-e822fdaeee90cb7c70d5678f19249198cd7aae8c.tar.gz PeerTube-e822fdaeee90cb7c70d5678f19249198cd7aae8c.tar.zst PeerTube-e822fdaeee90cb7c70d5678f19249198cd7aae8c.zip |
Use ng2-file-upload instead of jquery and add tags support to the video
upload form
Diffstat (limited to 'server')
-rw-r--r-- | server/initializers/constants.js | 4 | ||||
-rw-r--r-- | server/middlewares/reqValidators/videos.js | 2 | ||||
-rw-r--r-- | server/models/videos.js | 1 |
3 files changed, 4 insertions, 3 deletions
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' | |||
41 | const THUMBNAILS_STATIC_PATH = '/static/thumbnails' | 41 | const THUMBNAILS_STATIC_PATH = '/static/thumbnails' |
42 | 42 | ||
43 | const VIDEOS_CONSTRAINTS_FIELDS = { | 43 | const VIDEOS_CONSTRAINTS_FIELDS = { |
44 | NAME: { min: 1, max: 50 }, // Length | 44 | NAME: { min: 3, max: 50 }, // Length |
45 | DESCRIPTION: { min: 1, max: 250 }, // Length | 45 | DESCRIPTION: { min: 3, max: 250 }, // Length |
46 | MAGNET_URI: { min: 10 }, // Length | 46 | MAGNET_URI: { min: 10 }, // Length |
47 | DURATION: { min: 1, max: 7200 }, // Number | 47 | DURATION: { min: 1, max: 7200 }, // Number |
48 | AUTHOR: { min: 3, max: 20 }, // Length | 48 | 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) { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | if (!customValidators.isVideoDurationValid(duration)) { | 34 | if (!customValidators.isVideoDurationValid(duration)) { |
35 | return res.status(400).send('Duration of the video file is too big (max: ' + constants.MAXIMUM_VIDEO_DURATION + 's).') | 35 | return res.status(400).send('Duration of the video file is too big (max: ' + constants.VIDEOS_CONSTRAINTS_FIELDS.DURATION.max + 's).') |
36 | } | 36 | } |
37 | 37 | ||
38 | videoFile.duration = duration | 38 | 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') | |||
12 | 12 | ||
13 | // --------------------------------------------------------------------------- | 13 | // --------------------------------------------------------------------------- |
14 | 14 | ||
15 | // TODO: add indexes on searchable columns | ||
15 | const videosSchema = mongoose.Schema({ | 16 | const videosSchema = mongoose.Schema({ |
16 | name: String, | 17 | name: String, |
17 | namePath: String, | 18 | namePath: String, |