diff options
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index a41d37810..80a321117 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -1,10 +1,11 @@ | |||
1 | import validator from 'validator' | 1 | import validator from 'validator' |
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { ActivityTrackerUrlObject, ActivityVideoFileMetadataUrlObject } from '@shared/models' | 3 | import { ActivityTrackerUrlObject, ActivityVideoFileMetadataUrlObject } from '@shared/models' |
4 | import { VideoState } from '../../../../shared/models/videos' | 4 | import { LiveVideoLatencyMode, VideoState } from '../../../../shared/models/videos' |
5 | import { ACTIVITY_PUB, CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 5 | import { ACTIVITY_PUB, CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
6 | import { peertubeTruncate } from '../../core-utils' | 6 | import { peertubeTruncate } from '../../core-utils' |
7 | import { exists, isArray, isBooleanValid, isDateValid, isUUIDValid } from '../misc' | 7 | import { exists, isArray, isBooleanValid, isDateValid, isUUIDValid } from '../misc' |
8 | import { isLiveLatencyModeValid } from '../video-lives' | ||
8 | import { | 9 | import { |
9 | isVideoDurationValid, | 10 | isVideoDurationValid, |
10 | isVideoNameValid, | 11 | isVideoNameValid, |
@@ -65,6 +66,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { | |||
65 | if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false | 66 | if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false |
66 | if (!isBooleanValid(video.liveSaveReplay)) video.liveSaveReplay = false | 67 | if (!isBooleanValid(video.liveSaveReplay)) video.liveSaveReplay = false |
67 | if (!isBooleanValid(video.permanentLive)) video.permanentLive = false | 68 | if (!isBooleanValid(video.permanentLive)) video.permanentLive = false |
69 | if (!isLiveLatencyModeValid(video.latencyMode)) video.latencyMode = LiveVideoLatencyMode.DEFAULT | ||
68 | 70 | ||
69 | return isActivityPubUrlValid(video.id) && | 71 | return isActivityPubUrlValid(video.id) && |
70 | isVideoNameValid(video.name) && | 72 | isVideoNameValid(video.name) && |