aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/activitypub.ts1
-rw-r--r--server/helpers/audit-logger.ts3
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts2
3 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index eba552524..62d78373e 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -29,6 +29,7 @@ function activityPubContextify <T> (data: T) {
29 size: 'sc:Number', 29 size: 'sc:Number',
30 fps: 'sc:Number', 30 fps: 'sc:Number',
31 commentsEnabled: 'sc:Boolean', 31 commentsEnabled: 'sc:Boolean',
32 downloadEnabled: 'sc:Boolean',
32 waitTranscoding: 'sc:Boolean', 33 waitTranscoding: 'sc:Boolean',
33 expires: 'sc:expires', 34 expires: 'sc:expires',
34 support: 'sc:Text', 35 support: 'sc:Text',
diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts
index 00311fce1..a121f0b8a 100644
--- a/server/helpers/audit-logger.ts
+++ b/server/helpers/audit-logger.ts
@@ -117,7 +117,8 @@ const videoKeysToKeep = [
117 'channel-uuid', 117 'channel-uuid',
118 'channel-name', 118 'channel-name',
119 'support', 119 'support',
120 'commentsEnabled' 120 'commentsEnabled',
121 'downloadEnabled'
121] 122]
122class VideoAuditView extends EntityAuditView { 123class VideoAuditView extends EntityAuditView {
123 constructor (private video: VideoDetails) { 124 constructor (private video: VideoDetails) {
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index ad99c2724..53ad0588d 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -39,6 +39,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
39 // Default attributes 39 // Default attributes
40 if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED 40 if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
41 if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false 41 if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
42 if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
42 43
43 return isActivityPubUrlValid(video.id) && 44 return isActivityPubUrlValid(video.id) &&
44 isVideoNameValid(video.name) && 45 isVideoNameValid(video.name) &&
@@ -50,6 +51,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
50 isVideoViewsValid(video.views) && 51 isVideoViewsValid(video.views) &&
51 isBooleanValid(video.sensitive) && 52 isBooleanValid(video.sensitive) &&
52 isBooleanValid(video.commentsEnabled) && 53 isBooleanValid(video.commentsEnabled) &&
54 isBooleanValid(video.downloadEnabled) &&
53 isDateValid(video.published) && 55 isDateValid(video.published) &&
54 isDateValid(video.updated) && 56 isDateValid(video.updated) &&
55 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) && 57 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&