From 242f52253e46ce0ffd7349cb06bcd887bb89cf06 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 1 Mar 2022 08:32:49 +0100 Subject: Fix getting avatars in videos list --- server/models/video/sql/video/shared/video-model-builder.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/models') 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..166ff9d31 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,17 @@ 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 + const key = `${row.id}${id}` + + if (!id || this.actorImagesDone.has(key)) 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(key) } private addThumbnail (row: SQLRow, videoModel: VideoModel) { -- cgit v1.2.3