diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-02-21 21:35:59 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-02-26 20:01:26 +0100 |
commit | 9e167724f7e933f41d9ea2e1c31772bf4c560a28 (patch) | |
tree | 093cb7c1b088f35aaf847f859a313a121c8cd233 /server/middlewares/validators | |
parent | 0150b17e51df3e9fad8a59133d828c68f8ba672b (diff) | |
download | PeerTube-9e167724f7e933f41d9ea2e1c31772bf4c560a28.tar.gz PeerTube-9e167724f7e933f41d9ea2e1c31772bf4c560a28.tar.zst PeerTube-9e167724f7e933f41d9ea2e1c31772bf4c560a28.zip |
Server: make a basic "quick and dirty update" for videos
This system will be useful to to update some int video attributes
(likes, dislikes, views...)
The classic system is not used because we need some optimization for
scaling
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/remote/videos.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/middlewares/validators/remote/videos.js b/server/middlewares/validators/remote/videos.js index cf9925b6c..ddc274c45 100644 --- a/server/middlewares/validators/remote/videos.js +++ b/server/middlewares/validators/remote/videos.js | |||
@@ -4,7 +4,8 @@ const checkErrors = require('../utils').checkErrors | |||
4 | const logger = require('../../../helpers/logger') | 4 | const logger = require('../../../helpers/logger') |
5 | 5 | ||
6 | const validatorsRemoteVideos = { | 6 | const validatorsRemoteVideos = { |
7 | remoteVideos | 7 | remoteVideos, |
8 | remoteQaduVideos | ||
8 | } | 9 | } |
9 | 10 | ||
10 | function remoteVideos (req, res, next) { | 11 | function remoteVideos (req, res, next) { |
@@ -15,6 +16,14 @@ function remoteVideos (req, res, next) { | |||
15 | checkErrors(req, res, next) | 16 | checkErrors(req, res, next) |
16 | } | 17 | } |
17 | 18 | ||
19 | function remoteQaduVideos (req, res, next) { | ||
20 | req.checkBody('data').isEachRemoteRequestVideosQaduValid() | ||
21 | |||
22 | logger.debug('Checking remoteVideosQadu parameters', { parameters: req.body }) | ||
23 | |||
24 | checkErrors(req, res, next) | ||
25 | } | ||
26 | |||
18 | // --------------------------------------------------------------------------- | 27 | // --------------------------------------------------------------------------- |
19 | 28 | ||
20 | module.exports = validatorsRemoteVideos | 29 | module.exports = validatorsRemoteVideos |