aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/videos.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js
index 4aaa6aaa9..b76eec1b5 100644
--- a/server/helpers/custom-validators/videos.js
+++ b/server/helpers/custom-validators/videos.js
@@ -38,6 +38,17 @@ function isEachRemoteVideosValid (requests) {
38 isVideoExtnameValid(video.extname) 38 isVideoExtnameValid(video.extname)
39 ) || 39 ) ||
40 ( 40 (
41 isRequestTypeUpdateValid(request.type) &&
42 isVideoDateValid(video.createdAt) &&
43 isVideoDescriptionValid(video.description) &&
44 isVideoDurationValid(video.duration) &&
45 isVideoInfoHashValid(video.infoHash) &&
46 isVideoNameValid(video.name) &&
47 isVideoTagsValid(video.tags) &&
48 isVideoRemoteIdValid(video.remoteId) &&
49 isVideoExtnameValid(video.extname)
50 ) ||
51 (
41 isRequestTypeRemoveValid(request.type) && 52 isRequestTypeRemoveValid(request.type) &&
42 isVideoNameValid(video.name) && 53 isVideoNameValid(video.name) &&
43 isVideoRemoteIdValid(video.remoteId) 54 isVideoRemoteIdValid(video.remoteId)
@@ -104,6 +115,10 @@ function isRequestTypeAddValid (value) {
104 return value === 'add' 115 return value === 'add'
105} 116}
106 117
118function isRequestTypeUpdateValid (value) {
119 return value === 'update'
120}
121
107function isRequestTypeRemoveValid (value) { 122function isRequestTypeRemoveValid (value) {
108 return value === 'remove' 123 return value === 'remove'
109} 124}