aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/videos.js')
-rw-r--r--server/helpers/custom-validators/videos.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js
index da857ba5f..4aaa6aaa9 100644
--- a/server/helpers/custom-validators/videos.js
+++ b/server/helpers/custom-validators/videos.js
@@ -17,7 +17,7 @@ const videosValidators = {
17 isVideoNameValid, 17 isVideoNameValid,
18 isVideoTagsValid, 18 isVideoTagsValid,
19 isVideoThumbnailValid, 19 isVideoThumbnailValid,
20 isVideoThumbnail64Valid 20 isVideoThumbnailDataValid
21} 21}
22 22
23function isEachRemoteVideosValid (requests) { 23function isEachRemoteVideosValid (requests) {
@@ -33,7 +33,7 @@ function isEachRemoteVideosValid (requests) {
33 isVideoInfoHashValid(video.infoHash) && 33 isVideoInfoHashValid(video.infoHash) &&
34 isVideoNameValid(video.name) && 34 isVideoNameValid(video.name) &&
35 isVideoTagsValid(video.tags) && 35 isVideoTagsValid(video.tags) &&
36 isVideoThumbnail64Valid(video.thumbnailBase64) && 36 isVideoThumbnailDataValid(video.thumbnailData) &&
37 isVideoRemoteIdValid(video.remoteId) && 37 isVideoRemoteIdValid(video.remoteId) &&
38 isVideoExtnameValid(video.extname) 38 isVideoExtnameValid(video.extname)
39 ) || 39 ) ||
@@ -86,9 +86,8 @@ function isVideoThumbnailValid (value) {
86 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL) 86 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL)
87} 87}
88 88
89function isVideoThumbnail64Valid (value) { 89function isVideoThumbnailDataValid (value) {
90 return validator.isBase64(value) && 90 return validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL_DATA)
91 validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL64)
92} 91}
93 92
94function isVideoRemoteIdValid (value) { 93function isVideoRemoteIdValid (value) {