]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/videos.ts
Finish admin design
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / videos.ts
index 12c672fd2ea214fd3b3398da7ec488645d820f0e..2ed2988f55e04fd393a0b123f4a34ed2e604c222 100644 (file)
@@ -49,14 +49,14 @@ function isVideoTorrentObjectValid (video: any) {
     isActivityPubVideoDurationValid(video.duration) &&
     isUUIDValid(video.uuid) &&
     setValidRemoteTags(video) &&
-    isRemoteIdentifierValid(video.category) &&
-    isRemoteIdentifierValid(video.licence) &&
+    (!video.category || isRemoteIdentifierValid(video.category)) &&
+    (!video.licence || isRemoteIdentifierValid(video.licence)) &&
     (!video.language || isRemoteIdentifierValid(video.language)) &&
     isVideoViewsValid(video.views) &&
     isVideoNSFWValid(video.nsfw) &&
     isDateValid(video.published) &&
     isDateValid(video.updated) &&
-    isRemoteVideoContentValid(video.mediaType, video.content) &&
+    (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
     isRemoteVideoIconValid(video.icon) &&
     setValidRemoteVideoUrls(video) &&
     video.url.length !== 0