From d077c425d3c266d65e4c1b5174ecf512eb53adef Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 1 Jan 2021 12:35:03 -0700 Subject: [PATCH] Add only correct person blurhash --- Emby.Server.Implementations/Dto/DtoService.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 686944a286..d5e1f51248 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -582,7 +582,20 @@ namespace Emby.Server.Implementations.Dto { baseItemPerson.PrimaryImageTag = GetTagAndFillBlurhash(dto, entity, ImageType.Primary); baseItemPerson.Id = entity.Id.ToString("N", CultureInfo.InvariantCulture); - baseItemPerson.ImageBlurHashes = dto.ImageBlurHashes; + // Only add BlurHash for the person's image. + baseItemPerson.ImageBlurHashes = new Dictionary>(); + foreach (var (imageType, blurHash) in dto.ImageBlurHashes) + { + baseItemPerson.ImageBlurHashes[imageType] = new Dictionary(); + foreach (var (imageId, blurHashValue) in blurHash) + { + if (string.Equals(baseItemPerson.PrimaryImageTag, imageId, StringComparison.OrdinalIgnoreCase)) + { + baseItemPerson.ImageBlurHashes[imageType][imageId] = blurHashValue; + } + } + } + list.Add(baseItemPerson); } }