Comments enabled attrivute is optional in AP
authorChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:56:07 +0000 (14:56 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:56:07 +0000 (14:56 +0100)
server/helpers/custom-validators/activitypub/videos.ts

index fe94bd58a72a10adf599f018a9b5c235bb0ee2c1..224f03f4ee20c3b39c792a59ae2fbcbf929f5ae5 100644 (file)
@@ -56,6 +56,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
   if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
   if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
   if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
+  if (!isBooleanValid(video.commentsEnabled)) video.commentsEnabled = false
 
   return isActivityPubUrlValid(video.id) &&
     isVideoNameValid(video.name) &&