aboutsummaryrefslogtreecommitdiffhomepage
path: root/middlewares/reqValidators/remote.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2015-12-04 16:13:32 +0100
committerChocobozzz <florian.bigard@gmail.com>2015-12-04 16:13:32 +0100
commit0b69752270f1ceea06a29872b3db23660a55d6d3 (patch)
tree42da726633f3e48f4fe592cfd2c1ca14346a159b /middlewares/reqValidators/remote.js
parentaf82cae07dc568e3cb10acd70113df56eb8b15a9 (diff)
downloadPeerTube-0b69752270f1ceea06a29872b3db23660a55d6d3.tar.gz
PeerTube-0b69752270f1ceea06a29872b3db23660a55d6d3.tar.zst
PeerTube-0b69752270f1ceea06a29872b3db23660a55d6d3.zip
Add a pool of requests instead of making a request at each action (add
video/remove video) for performance in big networks
Diffstat (limited to 'middlewares/reqValidators/remote.js')
-rw-r--r--middlewares/reqValidators/remote.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/middlewares/reqValidators/remote.js b/middlewares/reqValidators/remote.js
index e851b49a4..642dad1c7 100644
--- a/middlewares/reqValidators/remote.js
+++ b/middlewares/reqValidators/remote.js
@@ -18,10 +18,8 @@
18 } 18 }
19 19
20 remote.remoteVideosAdd = function (req, res, next) { 20 remote.remoteVideosAdd = function (req, res, next) {
21 req.checkBody('data.name', 'Should have a name').isLength(1, 50) 21 req.checkBody('data').isArray()
22 req.checkBody('data.description', 'Should have a description').isLength(1, 250) 22 req.checkBody('data').eachIsRemoteVideosAddValid()
23 req.checkBody('data.magnetUri', 'Should have a magnetUri').notEmpty()
24 req.checkBody('data.podUrl', 'Should have a podUrl').isURL()
25 23
26 logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body }) 24 logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body })
27 25
@@ -29,7 +27,8 @@
29 } 27 }
30 28
31 remote.remoteVideosRemove = function (req, res, next) { 29 remote.remoteVideosRemove = function (req, res, next) {
32 req.checkBody('data.magnetUri', 'Should have a magnetUri').notEmpty() 30 req.checkBody('data').isArray()
31 req.checkBody('data').eachIsRemoteVideosRemoveValid()
33 32
34 logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body }) 33 logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body })
35 34