mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Merge pull request #4920 from crobibero/person-blurhash
Attach correct Blurhash to BaseItemPerson
This commit is contained in:
commit
c117b12b6b
@ -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<ImageType, Dictionary<string, string>>();
|
||||
foreach (var (imageType, blurHash) in dto.ImageBlurHashes)
|
||||
{
|
||||
baseItemPerson.ImageBlurHashes[imageType] = new Dictionary<string, string>();
|
||||
foreach (var (imageId, blurHashValue) in blurHash)
|
||||
{
|
||||
if (string.Equals(baseItemPerson.PrimaryImageTag, imageId, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
baseItemPerson.ImageBlurHashes[imageType][imageId] = blurHashValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list.Add(baseItemPerson);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user