From 558d7c2385d8a152a94140eed753f511e90986d7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 Nov 2016 13:47:50 +0100 Subject: Server: use _id for image and video files. Add remoteId field --- server/helpers/custom-validators/videos.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index a507ff686..c4c59808f 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js @@ -35,12 +35,13 @@ function isEachRemoteVideosValid (requests) { isVideoNameValid(video.name) && isVideoPodUrlValid(video.podUrl) && isVideoTagsValid(video.tags) && - isVideoThumbnail64Valid(video.thumbnailBase64) + isVideoThumbnail64Valid(video.thumbnailBase64) && + isVideoRemoteIdValid(video.remoteId) ) || ( isRequestTypeRemoveValid(request.type) && isVideoNameValid(video.name) && - isVideoMagnetUriValid(video.magnetUri) + isVideoRemoteIdValid(video.remoteId) ) }) } @@ -92,6 +93,10 @@ function isVideoThumbnail64Valid (value) { validator.isByteLength(value, VIDEOS_CONSTRAINTS_FIELDS.THUMBNAIL64) } +function isVideoRemoteIdValid (value) { + return validator.isMongoId(value) +} + // --------------------------------------------------------------------------- module.exports = videosValidators -- cgit v1.2.3