diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/remote/videos.ts | 4 | ||||
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/remote/videos.ts b/server/helpers/custom-validators/remote/videos.ts index a9ca36fe8..e0ffba679 100644 --- a/server/helpers/custom-validators/remote/videos.ts +++ b/server/helpers/custom-validators/remote/videos.ts | |||
@@ -19,7 +19,7 @@ import { | |||
19 | isRemoteVideoLicenceValid, | 19 | isRemoteVideoLicenceValid, |
20 | isRemoteVideoLanguageValid, | 20 | isRemoteVideoLanguageValid, |
21 | isVideoNSFWValid, | 21 | isVideoNSFWValid, |
22 | isVideoDescriptionValid, | 22 | isVideoTruncatedDescriptionValid, |
23 | isVideoDurationValid, | 23 | isVideoDurationValid, |
24 | isVideoFileInfoHashValid, | 24 | isVideoFileInfoHashValid, |
25 | isVideoNameValid, | 25 | isVideoNameValid, |
@@ -112,7 +112,7 @@ function isCommonVideoAttributesValid (video: any) { | |||
112 | isRemoteVideoLicenceValid(video.licence) && | 112 | isRemoteVideoLicenceValid(video.licence) && |
113 | isRemoteVideoLanguageValid(video.language) && | 113 | isRemoteVideoLanguageValid(video.language) && |
114 | isVideoNSFWValid(video.nsfw) && | 114 | isVideoNSFWValid(video.nsfw) && |
115 | isVideoDescriptionValid(video.description) && | 115 | isVideoTruncatedDescriptionValid(video.truncatedDescription) && |
116 | isVideoDurationValid(video.duration) && | 116 | isVideoDurationValid(video.duration) && |
117 | isVideoNameValid(video.name) && | 117 | isVideoNameValid(video.name) && |
118 | isVideoTagsValid(video.tags) && | 118 | isVideoTagsValid(video.tags) && |
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 11b085b78..5b9102275 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -54,6 +54,10 @@ function isVideoNSFWValid (value: any) { | |||
54 | return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value)) | 54 | return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value)) |
55 | } | 55 | } |
56 | 56 | ||
57 | function isVideoTruncatedDescriptionValid (value: string) { | ||
58 | return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.TRUNCATED_DESCRIPTION) | ||
59 | } | ||
60 | |||
57 | function isVideoDescriptionValid (value: string) { | 61 | function isVideoDescriptionValid (value: string) { |
58 | return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) | 62 | return exists(value) && validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION) |
59 | } | 63 | } |
@@ -173,6 +177,7 @@ export { | |||
173 | isVideoLicenceValid, | 177 | isVideoLicenceValid, |
174 | isVideoLanguageValid, | 178 | isVideoLanguageValid, |
175 | isVideoNSFWValid, | 179 | isVideoNSFWValid, |
180 | isVideoTruncatedDescriptionValid, | ||
176 | isVideoDescriptionValid, | 181 | isVideoDescriptionValid, |
177 | isVideoDurationValid, | 182 | isVideoDurationValid, |
178 | isVideoFileInfoHashValid, | 183 | isVideoFileInfoHashValid, |