diff options
Diffstat (limited to 'server/middlewares/validators/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts index 0a88e064e..bd223a1cb 100644 --- a/server/middlewares/validators/videos.ts +++ b/server/middlewares/validators/videos.ts | |||
@@ -23,7 +23,7 @@ function videosAddValidator (req: express.Request, res: express.Response, next: | |||
23 | 23 | ||
24 | logger.debug('Checking videosAdd parameters', { parameters: req.body, files: req.files }) | 24 | logger.debug('Checking videosAdd parameters', { parameters: req.body, files: req.files }) |
25 | 25 | ||
26 | checkErrors(req, res, function () { | 26 | checkErrors(req, res, () => { |
27 | const videoFile = req.files.videofile[0] | 27 | const videoFile = req.files.videofile[0] |
28 | 28 | ||
29 | db.Video.getDurationFromFile(videoFile.path) | 29 | db.Video.getDurationFromFile(videoFile.path) |
@@ -54,8 +54,8 @@ function videosUpdateValidator (req: express.Request, res: express.Response, nex | |||
54 | 54 | ||
55 | logger.debug('Checking videosUpdate parameters', { parameters: req.body }) | 55 | logger.debug('Checking videosUpdate parameters', { parameters: req.body }) |
56 | 56 | ||
57 | checkErrors(req, res, function () { | 57 | checkErrors(req, res, () => { |
58 | checkVideoExists(req.params.id, res, function () { | 58 | checkVideoExists(req.params.id, res, () => { |
59 | // We need to make additional checks | 59 | // We need to make additional checks |
60 | if (res.locals.video.isOwned() === false) { | 60 | if (res.locals.video.isOwned() === false) { |
61 | return res.status(403).send('Cannot update video of another pod') | 61 | return res.status(403).send('Cannot update video of another pod') |
@@ -75,7 +75,7 @@ function videosGetValidator (req: express.Request, res: express.Response, next: | |||
75 | 75 | ||
76 | logger.debug('Checking videosGet parameters', { parameters: req.params }) | 76 | logger.debug('Checking videosGet parameters', { parameters: req.params }) |
77 | 77 | ||
78 | checkErrors(req, res, function () { | 78 | checkErrors(req, res, () => { |
79 | checkVideoExists(req.params.id, res, next) | 79 | checkVideoExists(req.params.id, res, next) |
80 | }) | 80 | }) |
81 | } | 81 | } |
@@ -85,12 +85,12 @@ function videosRemoveValidator (req: express.Request, res: express.Response, nex | |||
85 | 85 | ||
86 | logger.debug('Checking videosRemove parameters', { parameters: req.params }) | 86 | logger.debug('Checking videosRemove parameters', { parameters: req.params }) |
87 | 87 | ||
88 | checkErrors(req, res, function () { | 88 | checkErrors(req, res, () => { |
89 | checkVideoExists(req.params.id, res, function () { | 89 | checkVideoExists(req.params.id, res, () => { |
90 | // We need to make additional checks | 90 | // We need to make additional checks |
91 | 91 | ||
92 | // Check if the user who did the request is able to delete the video | 92 | // Check if the user who did the request is able to delete the video |
93 | checkUserCanDeleteVideo(res.locals.oauth.token.User.id, res, function () { | 93 | checkUserCanDeleteVideo(res.locals.oauth.token.User.id, res, () => { |
94 | next() | 94 | next() |
95 | }) | 95 | }) |
96 | }) | 96 | }) |
@@ -113,7 +113,7 @@ function videoAbuseReportValidator (req: express.Request, res: express.Response, | |||
113 | 113 | ||
114 | logger.debug('Checking videoAbuseReport parameters', { parameters: req.body }) | 114 | logger.debug('Checking videoAbuseReport parameters', { parameters: req.body }) |
115 | 115 | ||
116 | checkErrors(req, res, function () { | 116 | checkErrors(req, res, () => { |
117 | checkVideoExists(req.params.id, res, next) | 117 | checkVideoExists(req.params.id, res, next) |
118 | }) | 118 | }) |
119 | } | 119 | } |
@@ -124,7 +124,7 @@ function videoRateValidator (req: express.Request, res: express.Response, next: | |||
124 | 124 | ||
125 | logger.debug('Checking videoRate parameters', { parameters: req.body }) | 125 | logger.debug('Checking videoRate parameters', { parameters: req.body }) |
126 | 126 | ||
127 | checkErrors(req, res, function () { | 127 | checkErrors(req, res, () => { |
128 | checkVideoExists(req.params.id, res, next) | 128 | checkVideoExists(req.params.id, res, next) |
129 | }) | 129 | }) |
130 | } | 130 | } |
@@ -134,8 +134,8 @@ function videosBlacklistValidator (req: express.Request, res: express.Response, | |||
134 | 134 | ||
135 | logger.debug('Checking videosBlacklist parameters', { parameters: req.params }) | 135 | logger.debug('Checking videosBlacklist parameters', { parameters: req.params }) |
136 | 136 | ||
137 | checkErrors(req, res, function () { | 137 | checkErrors(req, res, () => { |
138 | checkVideoExists(req.params.id, res, function () { | 138 | checkVideoExists(req.params.id, res, () => { |
139 | checkVideoIsBlacklistable(req, res, next) | 139 | checkVideoIsBlacklistable(req, res, next) |
140 | }) | 140 | }) |
141 | }) | 141 | }) |