mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Add federation to ownership change
This commit is contained in:
parent
0b74c74abe
commit
5cf84858d4
13 changed files with 139 additions and 79 deletions
|
@ -10,13 +10,19 @@ import { getUpdateActivityPubUrl } from '../url'
|
|||
import { broadcastToFollowers } from './utils'
|
||||
import { audiencify, getAudience } from '../audience'
|
||||
import { logger } from '../../../helpers/logger'
|
||||
import { videoFeedsValidator } from '../../../middlewares/validators'
|
||||
import { VideoCaptionModel } from '../../../models/video/video-caption'
|
||||
|
||||
async function sendUpdateVideo (video: VideoModel, t: Transaction) {
|
||||
async function sendUpdateVideo (video: VideoModel, t: Transaction, overrodeByActor?: ActorModel) {
|
||||
logger.info('Creating job to update video %s.', video.url)
|
||||
|
||||
const byActor = video.VideoChannel.Account.Actor
|
||||
const byActor = overrodeByActor ? overrodeByActor : video.VideoChannel.Account.Actor
|
||||
|
||||
const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())
|
||||
|
||||
// Needed to build the AP object
|
||||
if (!video.VideoCaptions) video.VideoCaptions = await video.$get('VideoCaptions') as VideoCaptionModel[]
|
||||
|
||||
const videoObject = video.toActivityPubObject()
|
||||
const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue