diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 09:54:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 09:54:46 +0200 |
commit | 6c1a098b4107cc923631d8cd94ed54c184fcec7d (patch) | |
tree | a7528c8dfb92aefbb50542c8e4bf267df9e695d7 /server/helpers | |
parent | 4613274479968f58f62c63178c92c1391de84297 (diff) | |
download | PeerTube-6c1a098b4107cc923631d8cd94ed54c184fcec7d.tar.gz PeerTube-6c1a098b4107cc923631d8cd94ed54c184fcec7d.tar.zst PeerTube-6c1a098b4107cc923631d8cd94ed54c184fcec7d.zip |
Server: fix remote videos requests validator
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) { |