From 156c50af3085468a47b8ae73fe8cfcae46b42398 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Sat, 6 Oct 2018 19:17:21 +0200 Subject: Add downloadingEnabled property to video model --- server/helpers/activitypub.ts | 1 + server/helpers/audit-logger.ts | 3 ++- server/helpers/custom-validators/activitypub/videos.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index 1304c7559..7f903e486 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -28,6 +28,7 @@ function activityPubContextify (data: T) { size: 'schema:Number', fps: 'schema:Number', commentsEnabled: 'schema:Boolean', + downloadingEnabled: 'schema:Boolean', waitTranscoding: 'schema:Boolean', expires: 'schema:expires', support: 'schema:Text', diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts index 00311fce1..d2c9aee01 100644 --- a/server/helpers/audit-logger.ts +++ b/server/helpers/audit-logger.ts @@ -117,7 +117,8 @@ const videoKeysToKeep = [ 'channel-uuid', 'channel-name', 'support', - 'commentsEnabled' + 'commentsEnabled', + 'downloadingEnabled' ] class VideoAuditView extends EntityAuditView { constructor (private video: VideoDetails) { diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index f88d26561..34e4cdff9 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts @@ -67,6 +67,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { isVideoViewsValid(video.views) && isBooleanValid(video.sensitive) && isBooleanValid(video.commentsEnabled) && + isBooleanValid(video.downloadingEnabled) && isDateValid(video.published) && isDateValid(video.updated) && (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) && -- cgit v1.2.3