diff options
Diffstat (limited to 'server/lib/activitypub/process/process-add.ts')
-rw-r--r-- | server/lib/activitypub/process/process-add.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/server/lib/activitypub/process/process-add.ts b/server/lib/activitypub/process/process-add.ts index 98280b9f0..e6bf63eb2 100644 --- a/server/lib/activitypub/process/process-add.ts +++ b/server/lib/activitypub/process/process-add.ts | |||
@@ -11,7 +11,7 @@ import { VideoInstance } from '../../../models/video/video-interface' | |||
11 | import { getOrCreateAccountAndServer } from '../account' | 11 | import { getOrCreateAccountAndServer } from '../account' |
12 | import { getOrCreateVideoChannel } from '../video-channels' | 12 | import { getOrCreateVideoChannel } from '../video-channels' |
13 | import { generateThumbnailFromUrl } from '../videos' | 13 | import { generateThumbnailFromUrl } from '../videos' |
14 | import { videoActivityObjectToDBAttributes, videoFileActivityUrlToDBAttributes } from './misc' | 14 | import { addVideoShares, videoActivityObjectToDBAttributes, videoFileActivityUrlToDBAttributes } from './misc' |
15 | 15 | ||
16 | async function processAddActivity (activity: ActivityAdd) { | 16 | async function processAddActivity (activity: ActivityAdd) { |
17 | const activityObject = activity.object | 17 | const activityObject = activity.object |
@@ -37,12 +37,10 @@ export { | |||
37 | 37 | ||
38 | // --------------------------------------------------------------------------- | 38 | // --------------------------------------------------------------------------- |
39 | 39 | ||
40 | async function processAddVideo ( | 40 | async function processAddVideo (account: AccountInstance, |
41 | account: AccountInstance, | 41 | activity: ActivityAdd, |
42 | activity: ActivityAdd, | 42 | videoChannel: VideoChannelInstance, |
43 | videoChannel: VideoChannelInstance, | 43 | videoToCreateData: VideoTorrentObject) { |
44 | videoToCreateData: VideoTorrentObject | ||
45 | ) { | ||
46 | const options = { | 44 | const options = { |
47 | arguments: [ account, activity, videoChannel, videoToCreateData ], | 45 | arguments: [ account, activity, videoChannel, videoToCreateData ], |
48 | errorMessage: 'Cannot insert the remote video with many retries.' | 46 | errorMessage: 'Cannot insert the remote video with many retries.' |
@@ -59,6 +57,10 @@ async function processAddVideo ( | |||
59 | await createRates(videoToCreateData.dislikes.orderedItems, video, 'dislike') | 57 | await createRates(videoToCreateData.dislikes.orderedItems, video, 'dislike') |
60 | } | 58 | } |
61 | 59 | ||
60 | if (videoToCreateData.shares && Array.isArray(videoToCreateData.shares.orderedItems)) { | ||
61 | await addVideoShares(video, videoToCreateData.shares.orderedItems) | ||
62 | } | ||
63 | |||
62 | return video | 64 | return video |
63 | } | 65 | } |
64 | 66 | ||