diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-15 09:23:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-15 09:26:37 +0100 |
commit | c9bc850e93295661e743255b8623ac8e2a95c391 (patch) | |
tree | 0dd03d2addfa03e0c92947b787af46414253a1c2 /server/middlewares/validators | |
parent | d1742ede65d2a42ffc02ab230287d83d432416f1 (diff) | |
download | PeerTube-c9bc850e93295661e743255b8623ac8e2a95c391.tar.gz PeerTube-c9bc850e93295661e743255b8623ac8e2a95c391.tar.zst PeerTube-c9bc850e93295661e743255b8623ac8e2a95c391.zip |
Use -1 for max live duration unlimited
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/config.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index 93de453a7..9c1cfa7e7 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -2,13 +2,13 @@ import * as express from 'express' | |||
2 | import { body } from 'express-validator' | 2 | import { body } from 'express-validator' |
3 | import { isIntOrNull } from '@server/helpers/custom-validators/misc' | 3 | import { isIntOrNull } from '@server/helpers/custom-validators/misc' |
4 | import { isEmailEnabled } from '@server/initializers/config' | 4 | import { isEmailEnabled } from '@server/initializers/config' |
5 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
5 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 6 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' |
6 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' | 7 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' |
7 | import { isUserNSFWPolicyValid, isUserVideoQuotaDailyValid, isUserVideoQuotaValid } from '../../helpers/custom-validators/users' | 8 | import { isUserNSFWPolicyValid, isUserVideoQuotaDailyValid, isUserVideoQuotaValid } from '../../helpers/custom-validators/users' |
8 | import { logger } from '../../helpers/logger' | 9 | import { logger } from '../../helpers/logger' |
9 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' | 10 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' |
10 | import { areValidationErrors } from './utils' | 11 | import { areValidationErrors } from './utils' |
11 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
12 | 12 | ||
13 | const customConfigUpdateValidator = [ | 13 | const customConfigUpdateValidator = [ |
14 | body('instance.name').exists().withMessage('Should have a valid instance name'), | 14 | body('instance.name').exists().withMessage('Should have a valid instance name'), |
@@ -65,7 +65,7 @@ const customConfigUpdateValidator = [ | |||
65 | 65 | ||
66 | body('live.enabled').isBoolean().withMessage('Should have a valid live enabled boolean'), | 66 | body('live.enabled').isBoolean().withMessage('Should have a valid live enabled boolean'), |
67 | body('live.allowReplay').isBoolean().withMessage('Should have a valid live allow replay boolean'), | 67 | body('live.allowReplay').isBoolean().withMessage('Should have a valid live allow replay boolean'), |
68 | body('live.maxDuration').custom(isIntOrNull).withMessage('Should have a valid live max duration'), | 68 | body('live.maxDuration').isInt().withMessage('Should have a valid live max duration'), |
69 | body('live.maxInstanceLives').custom(isIntOrNull).withMessage('Should have a valid max instance lives'), | 69 | body('live.maxInstanceLives').custom(isIntOrNull).withMessage('Should have a valid max instance lives'), |
70 | body('live.maxUserLives').custom(isIntOrNull).withMessage('Should have a valid max user lives'), | 70 | body('live.maxUserLives').custom(isIntOrNull).withMessage('Should have a valid max user lives'), |
71 | body('live.transcoding.enabled').isBoolean().withMessage('Should have a valid live transcoding enabled boolean'), | 71 | body('live.transcoding.enabled').isBoolean().withMessage('Should have a valid live transcoding enabled boolean'), |