aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/controllers/api/v1/remoteVideos.js4
-rw-r--r--server/middlewares/reqValidators/videos.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/api/v1/remoteVideos.js b/server/controllers/api/v1/remoteVideos.js
index 58222de52..2437b8c44 100644
--- a/server/controllers/api/v1/remoteVideos.js
+++ b/server/controllers/api/v1/remoteVideos.js
@@ -1,7 +1,7 @@
1'use strict' 1'use strict'
2 2
3const express = require('express') 3const express = require('express')
4const pluck = require('lodash-node/compat/collection/pluck') 4const map = require('lodash-node/modern/collection/map')
5 5
6const middleware = require('../../../middlewares') 6const middleware = require('../../../middlewares')
7const secureMiddleware = middleware.secure 7const secureMiddleware = middleware.secure
@@ -43,7 +43,7 @@ function addRemoteVideos (req, res, next) {
43 43
44function removeRemoteVideo (req, res, next) { 44function removeRemoteVideo (req, res, next) {
45 const url = req.body.signature.url 45 const url = req.body.signature.url
46 const magnetUris = pluck(req.body.data, 'magnetUri') 46 const magnetUris = map(req.body.data, 'magnetUri')
47 47
48 videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) { 48 videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) {
49 if (err) return next(err) 49 if (err) return next(err)
diff --git a/server/middlewares/reqValidators/videos.js b/server/middlewares/reqValidators/videos.js
index 12e878e81..c20660452 100644
--- a/server/middlewares/reqValidators/videos.js
+++ b/server/middlewares/reqValidators/videos.js
@@ -13,8 +13,8 @@ const reqValidatorsVideos = {
13} 13}
14 14
15function videosAdd (req, res, next) { 15function videosAdd (req, res, next) {
16 req.checkFiles('input_video[0].originalname', 'Should have an input video').notEmpty() 16 req.checkFiles('videofile[0].originalname', 'Should have an input video').notEmpty()
17 req.checkFiles('input_video[0].mimetype', 'Should have a correct mime type').matches(/video\/(webm)|(mp4)|(ogg)/i) 17 req.checkFiles('videofile[0].mimetype', 'Should have a correct mime type').matches(/video\/(webm)|(mp4)|(ogg)/i)
18 req.checkBody('name', 'Should have a name').isLength(1, 50) 18 req.checkBody('name', 'Should have a name').isLength(1, 50)
19 req.checkBody('description', 'Should have a description').isLength(1, 250) 19 req.checkBody('description', 'Should have a description').isLength(1, 250)
20 20