diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-files.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-files.ts | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/server/middlewares/validators/videos/video-files.ts b/server/middlewares/validators/videos/video-files.ts index b44c997e3..92c5b9483 100644 --- a/server/middlewares/validators/videos/video-files.ts +++ b/server/middlewares/validators/videos/video-files.ts | |||
@@ -1,17 +1,14 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { param } from 'express-validator' | ||
3 | import { isIdValid } from '@server/helpers/custom-validators/misc' | ||
2 | import { MVideo } from '@server/types/models' | 4 | import { MVideo } from '@server/types/models' |
3 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
4 | import { logger } from '../../../helpers/logger' | ||
5 | import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared' | 6 | import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared' |
6 | import { isIdValid } from '@server/helpers/custom-validators/misc' | ||
7 | import { param } from 'express-validator' | ||
8 | 7 | ||
9 | const videoFilesDeleteWebTorrentValidator = [ | 8 | const videoFilesDeleteWebTorrentValidator = [ |
10 | isValidVideoIdParam('id'), | 9 | isValidVideoIdParam('id'), |
11 | 10 | ||
12 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 11 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
13 | logger.debug('Checking videoFilesDeleteWebTorrent parameters', { parameters: req.params }) | ||
14 | |||
15 | if (areValidationErrors(req, res)) return | 12 | if (areValidationErrors(req, res)) return |
16 | if (!await doesVideoExist(req.params.id, res)) return | 13 | if (!await doesVideoExist(req.params.id, res)) return |
17 | 14 | ||
@@ -44,8 +41,6 @@ const videoFilesDeleteWebTorrentFileValidator = [ | |||
44 | .custom(isIdValid), | 41 | .custom(isIdValid), |
45 | 42 | ||
46 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 43 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
47 | logger.debug('Checking videoFilesDeleteWebTorrentFile parameters', { parameters: req.params }) | ||
48 | |||
49 | if (areValidationErrors(req, res)) return | 44 | if (areValidationErrors(req, res)) return |
50 | if (!await doesVideoExist(req.params.id, res)) return | 45 | if (!await doesVideoExist(req.params.id, res)) return |
51 | 46 | ||
@@ -78,8 +73,6 @@ const videoFilesDeleteHLSValidator = [ | |||
78 | isValidVideoIdParam('id'), | 73 | isValidVideoIdParam('id'), |
79 | 74 | ||
80 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 75 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
81 | logger.debug('Checking videoFilesDeleteHLS parameters', { parameters: req.params }) | ||
82 | |||
83 | if (areValidationErrors(req, res)) return | 76 | if (areValidationErrors(req, res)) return |
84 | if (!await doesVideoExist(req.params.id, res)) return | 77 | if (!await doesVideoExist(req.params.id, res)) return |
85 | 78 | ||
@@ -112,8 +105,6 @@ const videoFilesDeleteHLSFileValidator = [ | |||
112 | .custom(isIdValid), | 105 | .custom(isIdValid), |
113 | 106 | ||
114 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 107 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
115 | logger.debug('Checking videoFilesDeleteHLSFile parameters', { parameters: req.params }) | ||
116 | |||
117 | if (areValidationErrors(req, res)) return | 108 | if (areValidationErrors(req, res)) return |
118 | if (!await doesVideoExist(req.params.id, res)) return | 109 | if (!await doesVideoExist(req.params.id, res)) return |
119 | 110 | ||