diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/activitypub.ts | 10 | ||||
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index d28453d79..1188d6cf9 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts | |||
@@ -39,6 +39,16 @@ function getContextData (type: ContextType) { | |||
39 | sensitive: 'as:sensitive', | 39 | sensitive: 'as:sensitive', |
40 | language: 'sc:inLanguage', | 40 | language: 'sc:inLanguage', |
41 | 41 | ||
42 | isLiveBroadcast: 'sc:isLiveBroadcast', | ||
43 | liveSaveReplay: { | ||
44 | '@type': 'sc:Boolean', | ||
45 | '@id': 'pt:liveSaveReplay' | ||
46 | }, | ||
47 | permanentLive: { | ||
48 | '@type': 'sc:Boolean', | ||
49 | '@id': 'pt:permanentLive' | ||
50 | }, | ||
51 | |||
42 | Infohash: 'pt:Infohash', | 52 | Infohash: 'pt:Infohash', |
43 | Playlist: 'pt:Playlist', | 53 | Playlist: 'pt:Playlist', |
44 | PlaylistElement: 'pt:PlaylistElement', | 54 | PlaylistElement: 'pt:PlaylistElement', |
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index cb385b07d..a01429c83 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -64,6 +64,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { | |||
64 | if (!isBooleanValid(video.commentsEnabled)) video.commentsEnabled = false | 64 | if (!isBooleanValid(video.commentsEnabled)) video.commentsEnabled = false |
65 | if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false | 65 | if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false |
66 | if (!isBooleanValid(video.liveSaveReplay)) video.liveSaveReplay = false | 66 | if (!isBooleanValid(video.liveSaveReplay)) video.liveSaveReplay = false |
67 | if (!isBooleanValid(video.permanentLive)) video.permanentLive = false | ||
67 | 68 | ||
68 | return isActivityPubUrlValid(video.id) && | 69 | return isActivityPubUrlValid(video.id) && |
69 | isVideoNameValid(video.name) && | 70 | isVideoNameValid(video.name) && |
@@ -74,8 +75,6 @@ function sanitizeAndCheckVideoTorrentObject (video: any) { | |||
74 | (!video.language || isRemoteStringIdentifierValid(video.language)) && | 75 | (!video.language || isRemoteStringIdentifierValid(video.language)) && |
75 | isVideoViewsValid(video.views) && | 76 | isVideoViewsValid(video.views) && |
76 | isBooleanValid(video.sensitive) && | 77 | isBooleanValid(video.sensitive) && |
77 | isBooleanValid(video.commentsEnabled) && | ||
78 | isBooleanValid(video.downloadEnabled) && | ||
79 | isDateValid(video.published) && | 78 | isDateValid(video.published) && |
80 | isDateValid(video.updated) && | 79 | isDateValid(video.updated) && |
81 | (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) && | 80 | (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) && |