diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/videos.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index a507ff686..c4c59808f 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js | |||
@@ -35,12 +35,13 @@ function isEachRemoteVideosValid (requests) { | |||
35 | isVideoNameValid(video.name) && | 35 | isVideoNameValid(video.name) && |
36 | isVideoPodUrlValid(video.podUrl) && | 36 | isVideoPodUrlValid(video.podUrl) && |
37 | isVideoTagsValid(video.tags) && | 37 | isVideoTagsValid(video.tags) && |
38 | isVideoThumbnail64Valid(video.thumbnailBase64) | 38 | isVideoThumbnail64Valid(video.thumbnailBase64) && |
39 | isVideoRemoteIdValid(video.remoteId) | ||
39 | ) || | 40 | ) || |
40 | ( | 41 | ( |
41 | isRequestTypeRemoveValid(request.type) && | 42 | isRequestTypeRemoveValid(request.type) && |
42 | isVideoNameValid(video.name) && | 43 | isVideoNameValid(video.name) && |
43 | isVideoMagnetUriValid(video.magnetUri) | 44 | isVideoRemoteIdValid(video.remoteId) |
44 | ) | 45 | ) |
45 | }) | 46 | }) |
46 | } | 47 | } |
@@ -92,6 +93,10 @@ function isVideoThumbnail64Valid (value) { | |||
92 | validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL64) | 93 | validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL64) |
93 | } | 94 | } |
94 | 95 | ||
96 | function isVideoRemoteIdValid (value) { | ||
97 | return validator.isMongoId(value) | ||
98 | } | ||
99 | |||
95 | // --------------------------------------------------------------------------- | 100 | // --------------------------------------------------------------------------- |
96 | 101 | ||
97 | module.exports = videosValidators | 102 | module.exports = videosValidators |