aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-03 17:33:44 +0200
committerChocobozzz <me@florianbigard.com>2021-06-03 18:03:36 +0200
commit10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4 (patch)
tree008f8dad8032684f46105a261b27b2d6f05b36eb /server/middlewares/validators/videos/video-live.ts
parent5e08989ede1a340b9edb94465a11b1e04bf24094 (diff)
downloadPeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.tar.gz
PeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.tar.zst
PeerTube-10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4.zip
Move middleware utils in middlewares
helpers modules should not import models
Diffstat (limited to 'server/middlewares/validators/videos/video-live.ts')
-rw-r--r--server/middlewares/validators/videos/video-live.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/middlewares/validators/videos/video-live.ts b/server/middlewares/validators/videos/video-live.ts
index 0fb864098..ffc8c47b3 100644
--- a/server/middlewares/validators/videos/video-live.ts
+++ b/server/middlewares/validators/videos/video-live.ts
@@ -1,20 +1,19 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body, param } from 'express-validator' 2import { body, param } from 'express-validator'
3import { checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '@server/helpers/middlewares/videos' 3import { CONSTRAINTS_FIELDS } from '@server/initializers/constants'
4import { isLocalLiveVideoAccepted } from '@server/lib/moderation'
5import { Hooks } from '@server/lib/plugins/hooks'
6import { VideoModel } from '@server/models/video/video'
4import { VideoLiveModel } from '@server/models/video/video-live' 7import { VideoLiveModel } from '@server/models/video/video-live'
8import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
5import { ServerErrorCode, UserRight, VideoState } from '@shared/models' 9import { ServerErrorCode, UserRight, VideoState } from '@shared/models'
6import { isBooleanValid, isIdOrUUIDValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc' 10import { isBooleanValid, isIdOrUUIDValid, isIdValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc'
7import { isVideoNameValid } from '../../../helpers/custom-validators/videos' 11import { isVideoNameValid } from '../../../helpers/custom-validators/videos'
8import { cleanUpReqFiles } from '../../../helpers/express-utils' 12import { cleanUpReqFiles } from '../../../helpers/express-utils'
9import { logger } from '../../../helpers/logger' 13import { logger } from '../../../helpers/logger'
10import { CONFIG } from '../../../initializers/config' 14import { CONFIG } from '../../../initializers/config'
11import { areValidationErrors } from '../utils' 15import { areValidationErrors, checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '../shared'
12import { getCommonVideoEditAttributes } from './videos' 16import { getCommonVideoEditAttributes } from './videos'
13import { VideoModel } from '@server/models/video/video'
14import { Hooks } from '@server/lib/plugins/hooks'
15import { isLocalLiveVideoAccepted } from '@server/lib/moderation'
16import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
17import { CONSTRAINTS_FIELDS } from '@server/initializers/constants'
18 17
19const videoLiveGetValidator = [ 18const videoLiveGetValidator = [
20 param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), 19 param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'),