- await targetVideo.save()
- videoChangeOwnership.set('status', VideoChangeOwnershipStatus.ACCEPTED)
- await videoChangeOwnership.save()
+ targetVideo.channelId = channel.id
+
+ const targetVideoUpdated = await targetVideo.save({ transaction: t }) as MVideoFullLight
+ targetVideoUpdated.VideoChannel = channel
+
+ if (targetVideoUpdated.hasPrivacyForFederation() && targetVideoUpdated.state === VideoState.PUBLISHED) {
+ await changeVideoChannelShare(targetVideoUpdated, oldVideoChannel, t)
+ await sendUpdateVideo(targetVideoUpdated, t, oldVideoChannel.Account.Actor)
+ }
+
+ videoChangeOwnership.status = VideoChangeOwnershipStatus.ACCEPTED
+ await videoChangeOwnership.save({ transaction: t })