From 4d32448895ad29ef694bcf790d59253249ad5939 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 29 Dec 2016 12:13:19 +0100 Subject: Server: use binary data instead of base64 to send thumbnails --- server/helpers/custom-validators/videos.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'server/helpers/custom-validators') 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 = { isVideoNameValid, isVideoTagsValid, isVideoThumbnailValid, - isVideoThumbnail64Valid + isVideoThumbnailDataValid } function isEachRemoteVideosValid (requests) { @@ -33,7 +33,7 @@ function isEachRemoteVideosValid (requests) { isVideoInfoHashValid(video.infoHash) && isVideoNameValid(video.name) && isVideoTagsValid(video.tags) && - isVideoThumbnail64Valid(video.thumbnailBase64) && + isVideoThumbnailDataValid(video.thumbnailData) && isVideoRemoteIdValid(video.remoteId) && isVideoExtnameValid(video.extname) ) || @@ -86,9 +86,8 @@ function isVideoThumbnailValid (value) { return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL) } -function isVideoThumbnail64Valid (value) { - return validator.isBase64(value) && - validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL64) +function isVideoThumbnailDataValid (value) { + return validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL_DATA) } function isVideoRemoteIdValid (value) { -- cgit v1.2.3