1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Handle announces in inbox

This commit is contained in:
Chocobozzz 2017-11-15 17:56:21 +01:00
parent 8e10cf1a5a
commit d846501818
No known key found for this signature in database
GPG key ID: 583A612D890159BE
17 changed files with 264 additions and 23 deletions

View file

@ -39,7 +39,7 @@ function processAddVideo (account: AccountInstance, videoChannelUrl: string, vid
async function addRemoteVideo (account: AccountInstance, videoChannelUrl: string, videoToCreateData: VideoTorrentObject) {
logger.debug('Adding remote video %s.', videoToCreateData.url)
await db.sequelize.transaction(async t => {
return db.sequelize.transaction(async t => {
const sequelizeOptions = {
transaction: t
}
@ -66,7 +66,10 @@ async function addRemoteVideo (account: AccountInstance, videoChannelUrl: string
const tags = videoToCreateData.tag.map(t => t.name)
const tagInstances = await db.Tag.findOrCreateTags(tags, t)
await videoCreated.setTags(tagInstances, sequelizeOptions)
logger.info('Remote video with uuid %s inserted.', videoToCreateData.uuid)
return videoCreated
})
logger.info('Remote video with uuid %s inserted.', videoToCreateData.uuid)
}