diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:58:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:58:40 +0200 |
commit | a85d530384761a0af833caac9b38b9834517c9fa (patch) | |
tree | 5407dbcc32b6324067632d4c99f25a6b7d851230 /server/middlewares/validators/videos/video-playlists.ts | |
parent | 2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (diff) | |
download | PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.gz PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.zst PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.zip |
Remove unnecessary logs
Diffstat (limited to 'server/middlewares/validators/videos/video-playlists.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-playlists.ts | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 42e6646f9..6d4b8a6f1 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts | |||
@@ -29,7 +29,6 @@ import { | |||
29 | } from '../../../helpers/custom-validators/video-playlists' | 29 | } from '../../../helpers/custom-validators/video-playlists' |
30 | import { isVideoImageValid } from '../../../helpers/custom-validators/videos' | 30 | import { isVideoImageValid } from '../../../helpers/custom-validators/videos' |
31 | import { cleanUpReqFiles } from '../../../helpers/express-utils' | 31 | import { cleanUpReqFiles } from '../../../helpers/express-utils' |
32 | import { logger } from '../../../helpers/logger' | ||
33 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 32 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
34 | import { VideoPlaylistElementModel } from '../../../models/video/video-playlist-element' | 33 | import { VideoPlaylistElementModel } from '../../../models/video/video-playlist-element' |
35 | import { MVideoPlaylist } from '../../../types/models/video/video-playlist' | 34 | import { MVideoPlaylist } from '../../../types/models/video/video-playlist' |
@@ -48,8 +47,6 @@ const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([ | |||
48 | .custom(isVideoPlaylistNameValid), | 47 | .custom(isVideoPlaylistNameValid), |
49 | 48 | ||
50 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 49 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
51 | logger.debug('Checking videoPlaylistsAddValidator parameters', { parameters: req.body }) | ||
52 | |||
53 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) | 50 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) |
54 | 51 | ||
55 | const body: VideoPlaylistCreate = req.body | 52 | const body: VideoPlaylistCreate = req.body |
@@ -76,8 +73,6 @@ const videoPlaylistsUpdateValidator = getCommonPlaylistEditAttributes().concat([ | |||
76 | .custom(isVideoPlaylistNameValid), | 73 | .custom(isVideoPlaylistNameValid), |
77 | 74 | ||
78 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 75 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
79 | logger.debug('Checking videoPlaylistsUpdateValidator parameters', { parameters: req.body }) | ||
80 | |||
81 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) | 76 | if (areValidationErrors(req, res)) return cleanUpReqFiles(req) |
82 | 77 | ||
83 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return cleanUpReqFiles(req) | 78 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return cleanUpReqFiles(req) |
@@ -118,8 +113,6 @@ const videoPlaylistsDeleteValidator = [ | |||
118 | isValidPlaylistIdParam('playlistId'), | 113 | isValidPlaylistIdParam('playlistId'), |
119 | 114 | ||
120 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 115 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
121 | logger.debug('Checking videoPlaylistsDeleteValidator parameters', { parameters: req.params }) | ||
122 | |||
123 | if (areValidationErrors(req, res)) return | 116 | if (areValidationErrors(req, res)) return |
124 | 117 | ||
125 | if (!await doesVideoPlaylistExist(req.params.playlistId, res)) return | 118 | if (!await doesVideoPlaylistExist(req.params.playlistId, res)) return |
@@ -142,8 +135,6 @@ const videoPlaylistsGetValidator = (fetchType: VideoPlaylistFetchType) => { | |||
142 | isValidPlaylistIdParam('playlistId'), | 135 | isValidPlaylistIdParam('playlistId'), |
143 | 136 | ||
144 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 137 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
145 | logger.debug('Checking videoPlaylistsGetValidator parameters', { parameters: req.params }) | ||
146 | |||
147 | if (areValidationErrors(req, res)) return | 138 | if (areValidationErrors(req, res)) return |
148 | 139 | ||
149 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, fetchType)) return | 140 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, fetchType)) return |
@@ -189,8 +180,6 @@ const videoPlaylistsSearchValidator = [ | |||
189 | .not().isEmpty(), | 180 | .not().isEmpty(), |
190 | 181 | ||
191 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 182 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
192 | logger.debug('Checking videoPlaylists search query', { parameters: req.query }) | ||
193 | |||
194 | if (areValidationErrors(req, res)) return | 183 | if (areValidationErrors(req, res)) return |
195 | 184 | ||
196 | return next() | 185 | return next() |
@@ -211,8 +200,6 @@ const videoPlaylistsAddVideoValidator = [ | |||
211 | .custom(isVideoPlaylistTimestampValid), | 200 | .custom(isVideoPlaylistTimestampValid), |
212 | 201 | ||
213 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 202 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
214 | logger.debug('Checking videoPlaylistsAddVideoValidator parameters', { parameters: req.params }) | ||
215 | |||
216 | if (areValidationErrors(req, res)) return | 203 | if (areValidationErrors(req, res)) return |
217 | 204 | ||
218 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return | 205 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return |
@@ -241,8 +228,6 @@ const videoPlaylistsUpdateOrRemoveVideoValidator = [ | |||
241 | .custom(isVideoPlaylistTimestampValid), | 228 | .custom(isVideoPlaylistTimestampValid), |
242 | 229 | ||
243 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 230 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
244 | logger.debug('Checking videoPlaylistsRemoveVideoValidator parameters', { parameters: req.params }) | ||
245 | |||
246 | if (areValidationErrors(req, res)) return | 231 | if (areValidationErrors(req, res)) return |
247 | 232 | ||
248 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return | 233 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return |
@@ -271,8 +256,6 @@ const videoPlaylistElementAPGetValidator = [ | |||
271 | .custom(isIdValid), | 256 | .custom(isIdValid), |
272 | 257 | ||
273 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 258 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
274 | logger.debug('Checking videoPlaylistElementAPGetValidator parameters', { parameters: req.params }) | ||
275 | |||
276 | if (areValidationErrors(req, res)) return | 259 | if (areValidationErrors(req, res)) return |
277 | 260 | ||
278 | const playlistElementId = parseInt(req.params.playlistElementId + '', 10) | 261 | const playlistElementId = parseInt(req.params.playlistElementId + '', 10) |
@@ -312,8 +295,6 @@ const videoPlaylistsReorderVideosValidator = [ | |||
312 | .isInt({ min: 1 }), | 295 | .isInt({ min: 1 }), |
313 | 296 | ||
314 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 297 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
315 | logger.debug('Checking videoPlaylistsReorderVideosValidator parameters', { parameters: req.params }) | ||
316 | |||
317 | if (areValidationErrors(req, res)) return | 298 | if (areValidationErrors(req, res)) return |
318 | 299 | ||
319 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return | 300 | if (!await doesVideoPlaylistExist(req.params.playlistId, res, 'all')) return |
@@ -346,8 +327,6 @@ const commonVideoPlaylistFiltersValidator = [ | |||
346 | .custom(isVideoPlaylistTypeValid), | 327 | .custom(isVideoPlaylistTypeValid), |
347 | 328 | ||
348 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 329 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
349 | logger.debug('Checking commonVideoPlaylistFiltersValidator parameters', { parameters: req.params }) | ||
350 | |||
351 | if (areValidationErrors(req, res)) return | 330 | if (areValidationErrors(req, res)) return |
352 | 331 | ||
353 | return next() | 332 | return next() |
@@ -360,8 +339,6 @@ const doVideosInPlaylistExistValidator = [ | |||
360 | .custom(v => isArrayOf(v, isIdValid)).withMessage('Should have a valid video ids array'), | 339 | .custom(v => isArrayOf(v, isIdValid)).withMessage('Should have a valid video ids array'), |
361 | 340 | ||
362 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 341 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
363 | logger.debug('Checking areVideosInPlaylistExistValidator parameters', { parameters: req.query }) | ||
364 | |||
365 | if (areValidationErrors(req, res)) return | 342 | if (areValidationErrors(req, res)) return |
366 | 343 | ||
367 | return next() | 344 | return next() |