Fix loading actor involved in video
This commit is contained in:
parent
985e79f61e
commit
05d84f659d
|
@ -59,7 +59,7 @@ export async function getActorsInvolvedInVideo (video: MVideoId, t: Transaction)
|
||||||
? alreadyLoadedActor
|
? alreadyLoadedActor
|
||||||
: await ActorModel.loadAccountActorFollowerUrlByVideoId(video.id, t)
|
: await ActorModel.loadAccountActorFollowerUrlByVideoId(video.id, t)
|
||||||
|
|
||||||
actors.push(videoActor)
|
if (videoActor) actors.push(videoActor)
|
||||||
|
|
||||||
return actors
|
return actors
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,6 +359,11 @@ export class ActorModel extends SequelizeModel<ActorModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ActorModel.sequelize.query<MActorId & MActorFollowersUrl>(query, options)
|
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[]> {
|
static listByFollowersUrls (followersUrls: string[], transaction?: Transaction): Promise<MActorFull[]> {
|
||||||
|
|
Loading…
Reference in New Issue