diff options
Diffstat (limited to 'server/lib/activitypub/videos.ts')
-rw-r--r-- | server/lib/activitypub/videos.ts | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index e65362190..e7b516129 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts | |||
@@ -56,11 +56,8 @@ function generateThumbnailFromUrl (video: VideoModel, icon: ActivityIconObject) | |||
56 | 56 | ||
57 | async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelModel, | 57 | async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelModel, |
58 | videoObject: VideoTorrentObject, | 58 | videoObject: VideoTorrentObject, |
59 | to: string[] = [], | 59 | to: string[] = []) { |
60 | cc: string[] = []) { | 60 | const privacy = to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 ? VideoPrivacy.PUBLIC : VideoPrivacy.UNLISTED |
61 | let privacy = VideoPrivacy.PRIVATE | ||
62 | if (to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1) privacy = VideoPrivacy.PUBLIC | ||
63 | else if (cc.indexOf(ACTIVITY_PUB.PUBLIC) !== -1) privacy = VideoPrivacy.UNLISTED | ||
64 | 61 | ||
65 | const duration = videoObject.duration.replace(/[^\d]+/, '') | 62 | const duration = videoObject.duration.replace(/[^\d]+/, '') |
66 | let language = null | 63 | let language = null |
@@ -78,15 +75,8 @@ async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelMode | |||
78 | licence = parseInt(videoObject.licence.identifier, 10) | 75 | licence = parseInt(videoObject.licence.identifier, 10) |
79 | } | 76 | } |
80 | 77 | ||
81 | let description = null | 78 | const description = videoObject.content || null |
82 | if (videoObject.content) { | 79 | const support = videoObject.support || null |
83 | description = videoObject.content | ||
84 | } | ||
85 | |||
86 | let support = null | ||
87 | if (videoObject.support) { | ||
88 | support = videoObject.support | ||
89 | } | ||
90 | 80 | ||
91 | return { | 81 | return { |
92 | name: videoObject.name, | 82 | name: videoObject.name, |
@@ -157,7 +147,7 @@ async function getOrCreateVideo (videoObject: VideoTorrentObject, channelActor: | |||
157 | const videoFromDatabase = await VideoModel.loadByUUIDOrURLAndPopulateAccount(videoObject.uuid, videoObject.id, t) | 147 | const videoFromDatabase = await VideoModel.loadByUUIDOrURLAndPopulateAccount(videoObject.uuid, videoObject.id, t) |
158 | if (videoFromDatabase) return videoFromDatabase | 148 | if (videoFromDatabase) return videoFromDatabase |
159 | 149 | ||
160 | const videoData = await videoActivityObjectToDBAttributes(channelActor.VideoChannel, videoObject, videoObject.to, videoObject.cc) | 150 | const videoData = await videoActivityObjectToDBAttributes(channelActor.VideoChannel, videoObject, videoObject.to) |
161 | const video = VideoModel.build(videoData) | 151 | const video = VideoModel.build(videoData) |
162 | 152 | ||
163 | // Don't block on request | 153 | // Don't block on request |