diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index aea3453b5..5a49779ed 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -7,8 +7,8 @@ import { uploadx } from '@server/lib/uploadx' | |||
7 | import { getServerActor } from '@server/models/application/application' | 7 | import { getServerActor } from '@server/models/application/application' |
8 | import { ExpressPromiseHandler } from '@server/types/express-handler' | 8 | import { ExpressPromiseHandler } from '@server/types/express-handler' |
9 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' | 9 | import { MUserAccountId, MVideoFullLight } from '@server/types/models' |
10 | import { arrayify, getAllPrivacies } from '@shared/core-utils' | 10 | import { arrayify } from '@shared/core-utils' |
11 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoInclude, VideoState } from '@shared/models' | 11 | import { HttpStatusCode, ServerErrorCode, UserRight, VideoState } from '@shared/models' |
12 | import { | 12 | import { |
13 | exists, | 13 | exists, |
14 | isBooleanValid, | 14 | isBooleanValid, |
@@ -26,7 +26,6 @@ import { | |||
26 | isValidPasswordProtectedPrivacy, | 26 | isValidPasswordProtectedPrivacy, |
27 | isVideoCategoryValid, | 27 | isVideoCategoryValid, |
28 | isVideoDescriptionValid, | 28 | isVideoDescriptionValid, |
29 | isVideoFilterValid, | ||
30 | isVideoImageValid, | 29 | isVideoImageValid, |
31 | isVideoIncludeValid, | 30 | isVideoIncludeValid, |
32 | isVideoLanguageValid, | 31 | isVideoLanguageValid, |
@@ -464,9 +463,6 @@ const commonVideosFiltersValidator = [ | |||
464 | .optional() | 463 | .optional() |
465 | .customSanitizer(toBooleanOrNull) | 464 | .customSanitizer(toBooleanOrNull) |
466 | .custom(isBooleanValid).withMessage('Should have a valid isLive boolean'), | 465 | .custom(isBooleanValid).withMessage('Should have a valid isLive boolean'), |
467 | query('filter') | ||
468 | .optional() | ||
469 | .custom(isVideoFilterValid), | ||
470 | query('include') | 466 | query('include') |
471 | .optional() | 467 | .optional() |
472 | .custom(isVideoIncludeValid), | 468 | .custom(isVideoIncludeValid), |
@@ -501,22 +497,6 @@ const commonVideosFiltersValidator = [ | |||
501 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 497 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
502 | if (areValidationErrors(req, res)) return | 498 | if (areValidationErrors(req, res)) return |
503 | 499 | ||
504 | // FIXME: deprecated in 4.0, to remove | ||
505 | { | ||
506 | if (req.query.filter === 'all-local') { | ||
507 | req.query.include = VideoInclude.NOT_PUBLISHED_STATE | ||
508 | req.query.isLocal = true | ||
509 | req.query.privacyOneOf = getAllPrivacies() | ||
510 | } else if (req.query.filter === 'all') { | ||
511 | req.query.include = VideoInclude.NOT_PUBLISHED_STATE | ||
512 | req.query.privacyOneOf = getAllPrivacies() | ||
513 | } else if (req.query.filter === 'local') { | ||
514 | req.query.isLocal = true | ||
515 | } | ||
516 | |||
517 | req.query.filter = undefined | ||
518 | } | ||
519 | |||
520 | const user = res.locals.oauth?.token.User | 500 | const user = res.locals.oauth?.token.User |
521 | 501 | ||
522 | if ((!user || user.hasRight(UserRight.SEE_ALL_VIDEOS) !== true)) { | 502 | if ((!user || user.hasRight(UserRight.SEE_ALL_VIDEOS) !== true)) { |