Skip to content

Commit

Permalink
Fix loading actor involved in video
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Jun 21, 2024
1 parent 985e79f commit 05d84f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/core/lib/activitypub/send/shared/audience-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function getActorsInvolvedInVideo (video: MVideoId, t: Transaction)
? alreadyLoadedActor
: await ActorModel.loadAccountActorFollowerUrlByVideoId(video.id, t)

actors.push(videoActor)
if (videoActor) actors.push(videoActor)

return actors
}
5 changes: 5 additions & 0 deletions server/core/models/actor/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ export class ActorModel extends SequelizeModel<ActorModel> {
}

return ActorModel.sequelize.query<MActorId & MActorFollowersUrl>(query, options)
.then(res => {
if (res && res.length !== 0) return res[0]

return undefined
})
}

static listByFollowersUrls (followersUrls: string[], transaction?: Transaction): Promise<MActorFull[]> {
Expand Down

0 comments on commit 05d84f6

Please sign in to comment.