aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-15 09:23:28 +0100
committerChocobozzz <me@florianbigard.com>2020-12-15 09:26:37 +0100
commitc9bc850e93295661e743255b8623ac8e2a95c391 (patch)
tree0dd03d2addfa03e0c92947b787af46414253a1c2 /server/middlewares/validators
parentd1742ede65d2a42ffc02ab230287d83d432416f1 (diff)
downloadPeerTube-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.ts4
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'
2import { body } from 'express-validator' 2import { body } from 'express-validator'
3import { isIntOrNull } from '@server/helpers/custom-validators/misc' 3import { isIntOrNull } from '@server/helpers/custom-validators/misc'
4import { isEmailEnabled } from '@server/initializers/config' 4import { isEmailEnabled } from '@server/initializers/config'
5import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5import { CustomConfig } from '../../../shared/models/server/custom-config.model' 6import { CustomConfig } from '../../../shared/models/server/custom-config.model'
6import { isThemeNameValid } from '../../helpers/custom-validators/plugins' 7import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
7import { isUserNSFWPolicyValid, isUserVideoQuotaDailyValid, isUserVideoQuotaValid } from '../../helpers/custom-validators/users' 8import { isUserNSFWPolicyValid, isUserVideoQuotaDailyValid, isUserVideoQuotaValid } from '../../helpers/custom-validators/users'
8import { logger } from '../../helpers/logger' 9import { logger } from '../../helpers/logger'
9import { isThemeRegistered } from '../../lib/plugins/theme-utils' 10import { isThemeRegistered } from '../../lib/plugins/theme-utils'
10import { areValidationErrors } from './utils' 11import { areValidationErrors } from './utils'
11import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
12 12
13const customConfigUpdateValidator = [ 13const 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'),