]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Use map instead of pluck (lodash)
authorChocobozzz <florian.bigard@gmail.com>
Fri, 18 Mar 2016 15:34:50 +0000 (16:34 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 18 Mar 2016 15:34:50 +0000 (16:34 +0100)
server/controllers/api/v1/remoteVideos.js
server/middlewares/reqValidators/videos.js

index 58222de52736196d4483c2c4da703787e1710eaa..2437b8c44c34a1b5056c83521b859e3ed80ed18d 100644 (file)
@@ -1,7 +1,7 @@
 'use strict'
 
 const express = require('express')
-const pluck = require('lodash-node/compat/collection/pluck')
+const map = require('lodash-node/modern/collection/map')
 
 const middleware = require('../../../middlewares')
 const secureMiddleware = middleware.secure
@@ -43,7 +43,7 @@ function addRemoteVideos (req, res, next) {
 
 function removeRemoteVideo (req, res, next) {
   const url = req.body.signature.url
-  const magnetUris = pluck(req.body.data, 'magnetUri')
+  const magnetUris = map(req.body.data, 'magnetUri')
 
   videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) {
     if (err) return next(err)
index 12e878e81169f8c6ef58e2bdf1ed23e14160b2da..c20660452639645667c878603442cd6948de6ce0 100644 (file)
@@ -13,8 +13,8 @@ const reqValidatorsVideos = {
 }
 
 function videosAdd (req, res, next) {
-  req.checkFiles('input_video[0].originalname', 'Should have an input video').notEmpty()
-  req.checkFiles('input_video[0].mimetype', 'Should have a correct mime type').matches(/video\/(webm)|(mp4)|(ogg)/i)
+  req.checkFiles('videofile[0].originalname', 'Should have an input video').notEmpty()
+  req.checkFiles('videofile[0].mimetype', 'Should have a correct mime type').matches(/video\/(webm)|(mp4)|(ogg)/i)
   req.checkBody('name', 'Should have a name').isLength(1, 50)
   req.checkBody('description', 'Should have a description').isLength(1, 250)