From 5520a3eda6805338317a394d0553f2f82095a425 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Tue, 1 Mar 2022 00:50:42 +0100 Subject: [PATCH] fix: videos for api, include avatars --- server/models/video/sql/video/shared/video-model-builder.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/models/video/sql/video/shared/video-model-builder.ts b/server/models/video/sql/video/shared/video-model-builder.ts index b1b47b721..1fbcd5136 100644 --- a/server/models/video/sql/video/shared/video-model-builder.ts +++ b/server/models/video/sql/video/shared/video-model-builder.ts @@ -234,15 +234,15 @@ export class VideoModelBuilder { } private addActorAvatar (row: SQLRow, actorPrefix: string, actor: ActorModel) { - const avatarPrefix = `${actorPrefix}.Avatar` + const avatarPrefix = `${actorPrefix}.Avatars` const id = row[`${avatarPrefix}.id`] - if (!id || this.actorImagesDone.has(id)) return + if (!id || this.actorImagesDone.has(`${row.id}${id}`)) return const attributes = this.grab(row, this.tables.getAvatarAttributes(), avatarPrefix) const avatarModel = new ActorImageModel(attributes, this.buildOpts) actor.Avatars.push(avatarModel) - this.actorImagesDone.add(id) + this.actorImagesDone.add(`${row.id}${id}`) } private addThumbnail (row: SQLRow, videoModel: VideoModel) {