diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-15 17:56:21 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:52 +0100 |
commit | d846501818c2d29e66e6fd141789cb04fd55a437 (patch) | |
tree | 9b807a84459edd400fd36325c49c4adfbd6c4fd2 /server/lib/activitypub/process-add.ts | |
parent | 8e10cf1a5a438a00e5f7e0691cb830769867cffc (diff) | |
download | PeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.tar.gz PeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.tar.zst PeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.zip |
Handle announces in inbox
Diffstat (limited to 'server/lib/activitypub/process-add.ts')
-rw-r--r-- | server/lib/activitypub/process-add.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/activitypub/process-add.ts b/server/lib/activitypub/process-add.ts index 06d23a2ea..98e414dbb 100644 --- a/server/lib/activitypub/process-add.ts +++ b/server/lib/activitypub/process-add.ts | |||
@@ -39,7 +39,7 @@ function processAddVideo (account: AccountInstance, videoChannelUrl: string, vid | |||
39 | async function addRemoteVideo (account: AccountInstance, videoChannelUrl: string, videoToCreateData: VideoTorrentObject) { | 39 | async function addRemoteVideo (account: AccountInstance, videoChannelUrl: string, videoToCreateData: VideoTorrentObject) { |
40 | logger.debug('Adding remote video %s.', videoToCreateData.url) | 40 | logger.debug('Adding remote video %s.', videoToCreateData.url) |
41 | 41 | ||
42 | await db.sequelize.transaction(async t => { | 42 | return db.sequelize.transaction(async t => { |
43 | const sequelizeOptions = { | 43 | const sequelizeOptions = { |
44 | transaction: t | 44 | transaction: t |
45 | } | 45 | } |
@@ -66,7 +66,10 @@ async function addRemoteVideo (account: AccountInstance, videoChannelUrl: string | |||
66 | const tags = videoToCreateData.tag.map(t => t.name) | 66 | const tags = videoToCreateData.tag.map(t => t.name) |
67 | const tagInstances = await db.Tag.findOrCreateTags(tags, t) | 67 | const tagInstances = await db.Tag.findOrCreateTags(tags, t) |
68 | await videoCreated.setTags(tagInstances, sequelizeOptions) | 68 | await videoCreated.setTags(tagInstances, sequelizeOptions) |
69 | |||
70 | logger.info('Remote video with uuid %s inserted.', videoToCreateData.uuid) | ||
71 | |||
72 | return videoCreated | ||
69 | }) | 73 | }) |
70 | 74 | ||
71 | logger.info('Remote video with uuid %s inserted.', videoToCreateData.uuid) | ||
72 | } | 75 | } |