diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/videos.js | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index cffa973f8..ebe927208 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js | |||
@@ -22,26 +22,27 @@ const videosValidators = { | |||
22 | } | 22 | } |
23 | 23 | ||
24 | function isEachRemoteVideosValid (requests) { | 24 | function isEachRemoteVideosValid (requests) { |
25 | return requests.every(function (request) { | 25 | return miscValidators.isArray(requests) && |
26 | const video = request.data | 26 | requests.every(function (request) { |
27 | return ( | 27 | const video = request.data |
28 | isRequestTypeAddValid(request.type) && | 28 | return ( |
29 | isVideoAuthorValid(video.author) && | 29 | isRequestTypeAddValid(request.type) && |
30 | isVideoDateValid(video.createdDate) && | 30 | isVideoAuthorValid(video.author) && |
31 | isVideoDescriptionValid(video.description) && | 31 | isVideoDateValid(video.createdDate) && |
32 | isVideoDurationValid(video.duration) && | 32 | isVideoDescriptionValid(video.description) && |
33 | isVideoMagnetUriValid(video.magnetUri) && | 33 | isVideoDurationValid(video.duration) && |
34 | isVideoNameValid(video.name) && | 34 | isVideoMagnetUriValid(video.magnetUri) && |
35 | isVideoPodUrlValid(video.podUrl) && | 35 | isVideoNameValid(video.name) && |
36 | isVideoTagsValid(video.tags) && | 36 | isVideoPodUrlValid(video.podUrl) && |
37 | isVideoThumbnail64Valid(video.thumbnailBase64) | 37 | isVideoTagsValid(video.tags) && |
38 | ) || | 38 | isVideoThumbnail64Valid(video.thumbnailBase64) |
39 | ( | 39 | ) || |
40 | isRequestTypeRemoveValid(request.type) && | 40 | ( |
41 | isVideoNameValid(video.name) && | 41 | isRequestTypeRemoveValid(request.type) && |
42 | isVideoMagnetUriValid(video.magnetUri) | 42 | isVideoNameValid(video.name) && |
43 | ) | 43 | isVideoMagnetUriValid(video.magnetUri) |
44 | }) | 44 | ) |
45 | }) | ||
45 | } | 46 | } |
46 | 47 | ||
47 | function isVideoAuthorValid (value) { | 48 | function isVideoAuthorValid (value) { |