diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-03 14:10:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-03 15:21:16 +0100 |
commit | bb4ba6d94c5051fdd665ebe63fffcc105778b8be (patch) | |
tree | d39302608c53e31395683bb5dd551eac6ced89f8 /server/helpers | |
parent | 19b7ebfaa822b12f6da25ad2ba10398b3ef25ec6 (diff) | |
download | PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.gz PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.zst PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.zip |
Add permanent live support
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)) && |