diff options
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index 7e1d57c34..37c90a0c8 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -6,11 +6,13 @@ import { | |||
6 | isVideoAbuseReasonValid, | 6 | isVideoAbuseReasonValid, |
7 | isVideoDurationValid, | 7 | isVideoDurationValid, |
8 | isVideoNameValid, | 8 | isVideoNameValid, |
9 | isVideoStateValid, | ||
9 | isVideoTagValid, | 10 | isVideoTagValid, |
10 | isVideoTruncatedDescriptionValid, | 11 | isVideoTruncatedDescriptionValid, |
11 | isVideoViewsValid | 12 | isVideoViewsValid |
12 | } from '../videos' | 13 | } from '../videos' |
13 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' | 14 | import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc' |
15 | import { VideoState } from '../../../../shared/models/videos' | ||
14 | 16 | ||
15 | function sanitizeAndCheckVideoTorrentCreateActivity (activity: any) { | 17 | function sanitizeAndCheckVideoTorrentCreateActivity (activity: any) { |
16 | return isBaseActivityValid(activity, 'Create') && | 18 | return isBaseActivityValid(activity, 'Create') && |
@@ -50,6 +52,10 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { | |||
50 | if (!setRemoteVideoTruncatedContent(video)) return false | 52 | if (!setRemoteVideoTruncatedContent(video)) return false |
51 | if (!setValidAttributedTo(video)) return false | 53 | if (!setValidAttributedTo(video)) return false |
52 | 54 | ||
55 | // Default attributes | ||
56 | if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED | ||
57 | if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false | ||
58 | |||
53 | return isActivityPubUrlValid(video.id) && | 59 | return isActivityPubUrlValid(video.id) && |
54 | isVideoNameValid(video.name) && | 60 | isVideoNameValid(video.name) && |
55 | isActivityPubVideoDurationValid(video.duration) && | 61 | isActivityPubVideoDurationValid(video.duration) && |