import { Hooks } from '@server/lib/plugins/hooks'
import { VideoModel } from '@server/models/video/video'
import { VideoLiveModel } from '@server/models/video/video-live'
+import { VideoLiveSessionModel } from '@server/models/video/video-live-session'
import {
HttpStatusCode,
LiveVideoCreate,
isValidVideoIdParam
} from '../shared'
import { getCommonVideoEditAttributes } from './videos'
-import { VideoLiveSessionModel } from '@server/models/video/video-live-session'
const videoLiveGetValidator = [
isValidVideoIdParam('videoId'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoLiveGetValidator parameters', { parameters: req.params })
-
if (areValidationErrors(req, res)) return
if (!await doesVideoExist(req.params.videoId, res, 'all')) return
.custom(isLiveLatencyModeValid),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoLiveAddValidator parameters', { parameters: req.body })
-
if (areValidationErrors(req, res)) return cleanUpReqFiles(req)
if (CONFIG.LIVE.ENABLED !== true) {
.custom(isLiveLatencyModeValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoLiveUpdateValidator parameters', { parameters: req.body })
-
if (areValidationErrors(req, res)) return
const body: LiveVideoUpdate = req.body
const videoLiveListSessionsValidator = [
(req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoLiveListSessionsValidator parameters', { parameters: req.params })
-
// Check the user can manage the live
const user = res.locals.oauth.token.User
if (!checkUserCanManageVideo(user, res.locals.videoAll, UserRight.GET_ANY_LIVE, res)) return
isValidVideoIdParam('videoId'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoLiveFindReplaySessionValidator parameters', { parameters: req.params })
-
if (areValidationErrors(req, res)) return
if (!await doesVideoExist(req.params.videoId, res, 'id')) return