Fix getting avatars in videos list

This commit is contained in:
Chocobozzz
2022-03-01 08:32:49 +01:00
parent f41efa52a4
commit 242f52253e
2 changed files with 23 additions and 3 deletions

View File

@@ -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) {