mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Basic video redundancy implementation
This commit is contained in:
parent
a651038487
commit
c48e82b5e0
77 changed files with 1667 additions and 287 deletions
|
@ -17,20 +17,20 @@ async function sendLike (byActor: ActorModel, video: VideoModel, t: Transaction)
|
|||
// Send to origin
|
||||
if (video.isOwned() === false) {
|
||||
const audience = getVideoAudience(video, accountsInvolvedInVideo)
|
||||
const data = likeActivityData(url, byActor, video, audience)
|
||||
const data = buildLikeActivity(url, byActor, video, audience)
|
||||
|
||||
return unicastTo(data, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl)
|
||||
}
|
||||
|
||||
// Send to followers
|
||||
const audience = getObjectFollowersAudience(accountsInvolvedInVideo)
|
||||
const data = likeActivityData(url, byActor, video, audience)
|
||||
const activity = buildLikeActivity(url, byActor, video, audience)
|
||||
|
||||
const followersException = [ byActor ]
|
||||
return broadcastToFollowers(data, byActor, accountsInvolvedInVideo, t, followersException)
|
||||
return broadcastToFollowers(activity, byActor, accountsInvolvedInVideo, t, followersException)
|
||||
}
|
||||
|
||||
function likeActivityData (url: string, byActor: ActorModel, video: VideoModel, audience?: ActivityAudience): ActivityLike {
|
||||
function buildLikeActivity (url: string, byActor: ActorModel, video: VideoModel, audience?: ActivityAudience): ActivityLike {
|
||||
if (!audience) audience = getAudience(byActor)
|
||||
|
||||
return audiencify(
|
||||
|
@ -48,5 +48,5 @@ function likeActivityData (url: string, byActor: ActorModel, video: VideoModel,
|
|||
|
||||
export {
|
||||
sendLike,
|
||||
likeActivityData
|
||||
buildLikeActivity
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue