}
})
-const reqFiles = multer({ storage: storage }).fields([{ name: 'input_video', maxCount: 1 }])
+const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }])
router.get('/', cacheMiddleware.cache(false), listVideos)
router.post('/', reqFiles, reqValidator.videosAdd, cacheMiddleware.cache(false), addVideo)
// ---------------------------------------------------------------------------
function addVideo (req, res, next) {
- const video_file = req.files.input_video[0]
+ const video_file = req.files.videofile[0]
const video_infos = req.body
videos.seed(video_file.path, function (err, torrent) {
description: 'my super description'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
}
makePostRequest(path, data, attach, done)
})
description: 'my super description'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
}
makePostRequest(path, data, attach, done)
})
name: 'my super name'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
}
makePostRequest(path, data, attach, done)
})
'very very very very very very very very very very very very very very very long'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
}
makePostRequest(path, data, attach, done)
})
description: 'my super description'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
+ 'videofile': pathUtils.join(__dirname, '..', 'fixtures', 'video_short_fake.webm')
}
makePostRequest(path, data, attach, done)
})
description: 'my super description'
}
const attach = {
- 'input_video': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
+ 'videofile': pathUtils.join(__dirname, 'fixtures', 'video_short.webm')
}
makePostRequest(path, data, attach, function () {
- attach.input_video = pathUtils.join(__dirname, 'fixtures', 'video_short.mp4')
+ attach.videofile = pathUtils.join(__dirname, 'fixtures', 'video_short.mp4')
makePostRequest(path, data, attach, function () {
- attach.input_video = pathUtils.join(__dirname, 'fixtures', 'video_short.ogv')
+ attach.videofile = pathUtils.join(__dirname, 'fixtures', 'video_short.ogv')
makePostRequest(path, data, attach, done, true)
}, true)
}, true)