aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-03 11:06:19 +0200
committerChocobozzz <me@florianbigard.com>2021-05-03 16:42:15 +0200
commit1fd61899eaea245a5844e33e21f04b2562f16e5e (patch)
tree2a1d51b37b12219cade35e189d62686cd0fec105 /server/middlewares
parentdfcb6f50a607b6b402b4f8fa3d43792d61c912a5 (diff)
downloadPeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.gz
PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.zst
PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.zip
Add ability to filter my videos by live
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/videos/videos.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 4d31d3dcb..bb617d77c 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -20,7 +20,7 @@ import {
20 toIntOrNull, 20 toIntOrNull,
21 toValueOrNull 21 toValueOrNull
22} from '../../../helpers/custom-validators/misc' 22} from '../../../helpers/custom-validators/misc'
23import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' 23import { isBooleanBothQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search'
24import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } from '../../../helpers/custom-validators/video-ownership' 24import { checkUserCanTerminateOwnershipChange, doesChangeVideoOwnershipExist } from '../../../helpers/custom-validators/video-ownership'
25import { 25import {
26 isScheduleVideoUpdatePrivacyValid, 26 isScheduleVideoUpdatePrivacyValid,
@@ -439,7 +439,11 @@ const commonVideosFiltersValidator = [
439 .custom(isStringArray).withMessage('Should have a valid all of tags array'), 439 .custom(isStringArray).withMessage('Should have a valid all of tags array'),
440 query('nsfw') 440 query('nsfw')
441 .optional() 441 .optional()
442 .custom(isNSFWQueryValid).withMessage('Should have a valid NSFW attribute'), 442 .custom(isBooleanBothQueryValid).withMessage('Should have a valid NSFW attribute'),
443 query('isLive')
444 .optional()
445 .customSanitizer(toBooleanOrNull)
446 .custom(isBooleanValid).withMessage('Should have a valid live boolean'),
443 query('filter') 447 query('filter')
444 .optional() 448 .optional()
445 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'), 449 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'),