]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/videos.js
Server: propagate video update to other pods
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / videos.js
index 4aaa6aaa99c37454457309b3e8651cc8ecef3117..b76eec1b5b72a8795697e70776766b435c1263ce 100644 (file)
@@ -37,6 +37,17 @@ function isEachRemoteVideosValid (requests) {
         isVideoRemoteIdValid(video.remoteId) &&
         isVideoExtnameValid(video.extname)
       ) ||
+      (
+        isRequestTypeUpdateValid(request.type) &&
+        isVideoDateValid(video.createdAt) &&
+        isVideoDescriptionValid(video.description) &&
+        isVideoDurationValid(video.duration) &&
+        isVideoInfoHashValid(video.infoHash) &&
+        isVideoNameValid(video.name) &&
+        isVideoTagsValid(video.tags) &&
+        isVideoRemoteIdValid(video.remoteId) &&
+        isVideoExtnameValid(video.extname)
+      ) ||
       (
         isRequestTypeRemoveValid(request.type) &&
         isVideoNameValid(video.name) &&
@@ -104,6 +115,10 @@ function isRequestTypeAddValid (value) {
   return value === 'add'
 }
 
+function isRequestTypeUpdateValid (value) {
+  return value === 'update'
+}
+
 function isRequestTypeRemoveValid (value) {
   return value === 'remove'
 }