]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/videos.ts
Improve channel and account SEO
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / videos.ts
index ad99c27242f6c718923c34784cab8565f20782a2..d943331512feb52b38fc82f04f7c123d4e89f322 100644 (file)
@@ -39,6 +39,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
   // Default attributes
   if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
   if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
+  if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
 
   return isActivityPubUrlValid(video.id) &&
     isVideoNameValid(video.name) &&
@@ -50,8 +51,10 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
     isVideoViewsValid(video.views) &&
     isBooleanValid(video.sensitive) &&
     isBooleanValid(video.commentsEnabled) &&
+    isBooleanValid(video.downloadEnabled) &&
     isDateValid(video.published) &&
     isDateValid(video.updated) &&
+    (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) &&
     (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
     isRemoteVideoIconValid(video.icon) &&
     video.url.length !== 0 &&