diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-30 10:16:27 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-30 10:16:27 +0100 |
commit | 9567011bf01f36c7f796ac1e0f1fb12c71635e53 (patch) | |
tree | bec3ed173767cff031ed0a84231d6dd50e792569 /server/helpers/custom-validators/videos.ts | |
parent | 757f0da370a992cf07afd20d3829b2748c76cc15 (diff) | |
download | PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.tar.gz PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.tar.zst PeerTube-9567011bf01f36c7f796ac1e0f1fb12c71635e53.zip |
Add lazy description on server
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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, |