diff options
Diffstat (limited to 'routes/api/v1/remoteVideos.js')
-rw-r--r-- | routes/api/v1/remoteVideos.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/routes/api/v1/remoteVideos.js b/routes/api/v1/remoteVideos.js deleted file mode 100644 index 6ba6ce17b..000000000 --- a/routes/api/v1/remoteVideos.js +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | ;(function () { | ||
2 | 'use strict' | ||
3 | |||
4 | var express = require('express') | ||
5 | var router = express.Router() | ||
6 | var pluck = require('lodash-node/compat/collection/pluck') | ||
7 | |||
8 | var middleware = require('../../../middlewares') | ||
9 | var miscMiddleware = middleware.misc | ||
10 | var reqValidator = middleware.reqValidators.remote | ||
11 | var videos = require('../../../src/videos') | ||
12 | |||
13 | function addRemoteVideos (req, res, next) { | ||
14 | videos.addRemotes(req.body.data, function (err, videos) { | ||
15 | if (err) return next(err) | ||
16 | |||
17 | res.json(videos) | ||
18 | }) | ||
19 | } | ||
20 | |||
21 | function removeRemoteVideo (req, res, next) { | ||
22 | videos.removeRemotes(req.body.signature.url, pluck(req.body.data, 'magnetUri'), function (err) { | ||
23 | if (err) return next(err) | ||
24 | |||
25 | res.sendStatus(204) | ||
26 | }) | ||
27 | } | ||
28 | |||
29 | router.post('/add', reqValidator.secureRequest, miscMiddleware.decryptBody, reqValidator.remoteVideosAdd, miscMiddleware.cache(false), addRemoteVideos) | ||
30 | router.post('/remove', reqValidator.secureRequest, miscMiddleware.decryptBody, reqValidator.remoteVideosRemove, miscMiddleware.cache(false), removeRemoteVideo) | ||
31 | |||
32 | module.exports = router | ||
33 | })() | ||