logger.debug('Checking videosAdd parameters', { parameters: req.body, files: req.files })
- checkErrors(req, res, function () {
- const videoFile = req.files.videofile[0]
+ checkErrors(req, res, () => {
+ const videoFile = req.files['videofile'][0]
db.Video.getDurationFromFile(videoFile.path)
.then(duration => {
logger.debug('Checking videosUpdate parameters', { parameters: req.body })
- checkErrors(req, res, function () {
- checkVideoExists(req.params.id, res, function () {
+ checkErrors(req, res, () => {
+ checkVideoExists(req.params.id, res, () => {
// We need to make additional checks
if (res.locals.video.isOwned() === false) {
return res.status(403).send('Cannot update video of another pod')
logger.debug('Checking videosGet parameters', { parameters: req.params })
- checkErrors(req, res, function () {
+ checkErrors(req, res, () => {
checkVideoExists(req.params.id, res, next)
})
}
logger.debug('Checking videosRemove parameters', { parameters: req.params })
- checkErrors(req, res, function () {
- checkVideoExists(req.params.id, res, function () {
+ checkErrors(req, res, () => {
+ checkVideoExists(req.params.id, res, () => {
// We need to make additional checks
// Check if the user who did the request is able to delete the video
- checkUserCanDeleteVideo(res.locals.oauth.token.User.id, res, function () {
+ checkUserCanDeleteVideo(res.locals.oauth.token.User.id, res, () => {
next()
})
})
logger.debug('Checking videoAbuseReport parameters', { parameters: req.body })
- checkErrors(req, res, function () {
+ checkErrors(req, res, () => {
checkVideoExists(req.params.id, res, next)
})
}
logger.debug('Checking videoRate parameters', { parameters: req.body })
- checkErrors(req, res, function () {
+ checkErrors(req, res, () => {
checkVideoExists(req.params.id, res, next)
})
}
logger.debug('Checking videosBlacklist parameters', { parameters: req.params })
- checkErrors(req, res, function () {
- checkVideoExists(req.params.id, res, function () {
+ checkErrors(req, res, () => {
+ checkVideoExists(req.params.id, res, () => {
checkVideoIsBlacklistable(req, res, next)
})
})