mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Server: use binary data instead of base64 to send thumbnails
This commit is contained in:
parent
98ac898a03
commit
4d32448895
6 changed files with 14 additions and 15 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue