|
|
|
@ -41,7 +41,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
private readonly ILogger<DtoService> _logger;
|
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
|
private readonly IUserDataManager _userDataRepository;
|
|
|
|
|
private readonly IItemRepository _itemRepo;
|
|
|
|
|
|
|
|
|
|
private readonly IImageProcessor _imageProcessor;
|
|
|
|
|
private readonly IProviderManager _providerManager;
|
|
|
|
@ -58,7 +57,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
ILogger<DtoService> logger,
|
|
|
|
|
ILibraryManager libraryManager,
|
|
|
|
|
IUserDataManager userDataRepository,
|
|
|
|
|
IItemRepository itemRepo,
|
|
|
|
|
IImageProcessor imageProcessor,
|
|
|
|
|
IProviderManager providerManager,
|
|
|
|
|
IRecordingsManager recordingsManager,
|
|
|
|
@ -71,7 +69,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_libraryManager = libraryManager;
|
|
|
|
|
_userDataRepository = userDataRepository;
|
|
|
|
|
_itemRepo = itemRepo;
|
|
|
|
|
_imageProcessor = imageProcessor;
|
|
|
|
|
_providerManager = providerManager;
|
|
|
|
|
_recordingsManager = recordingsManager;
|
|
|
|
@ -99,11 +96,11 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (item is LiveTvChannel tvChannel)
|
|
|
|
|
{
|
|
|
|
|
(channelTuples ??= new()).Add((dto, tvChannel));
|
|
|
|
|
(channelTuples ??= []).Add((dto, tvChannel));
|
|
|
|
|
}
|
|
|
|
|
else if (item is LiveTvProgram)
|
|
|
|
|
{
|
|
|
|
|
(programTuples ??= new()).Add((item, dto));
|
|
|
|
|
(programTuples ??= []).Add((item, dto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item is IItemByName byName)
|
|
|
|
@ -590,12 +587,12 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (dto.ImageBlurHashes is not null)
|
|
|
|
|
{
|
|
|
|
|
// Only add BlurHash for the person's image.
|
|
|
|
|
baseItemPerson.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
baseItemPerson.ImageBlurHashes = [];
|
|
|
|
|
foreach (var (imageType, blurHash) in dto.ImageBlurHashes)
|
|
|
|
|
{
|
|
|
|
|
if (blurHash is not null)
|
|
|
|
|
{
|
|
|
|
|
baseItemPerson.ImageBlurHashes[imageType] = new Dictionary<string, string>();
|
|
|
|
|
baseItemPerson.ImageBlurHashes[imageType] = [];
|
|
|
|
|
foreach (var (imageId, blurHashValue) in blurHash)
|
|
|
|
|
{
|
|
|
|
|
if (string.Equals(baseItemPerson.PrimaryImageTag, imageId, StringComparison.OrdinalIgnoreCase))
|
|
|
|
@ -674,11 +671,11 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(image.BlurHash))
|
|
|
|
|
{
|
|
|
|
|
dto.ImageBlurHashes ??= new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
dto.ImageBlurHashes ??= [];
|
|
|
|
|
|
|
|
|
|
if (!dto.ImageBlurHashes.TryGetValue(image.Type, out var value))
|
|
|
|
|
{
|
|
|
|
|
value = new Dictionary<string, string>();
|
|
|
|
|
value = [];
|
|
|
|
|
dto.ImageBlurHashes[image.Type] = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -709,7 +706,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (hashes.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dto.ImageBlurHashes ??= new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
dto.ImageBlurHashes ??= [];
|
|
|
|
|
|
|
|
|
|
dto.ImageBlurHashes[imageType] = hashes;
|
|
|
|
|
}
|
|
|
|
@ -756,7 +753,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
dto.AspectRatio = hasAspectRatio.AspectRatio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
dto.ImageBlurHashes = [];
|
|
|
|
|
|
|
|
|
|
var backdropLimit = options.GetImageLimit(ImageType.Backdrop);
|
|
|
|
|
if (backdropLimit > 0)
|
|
|
|
@ -772,7 +769,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (options.EnableImages)
|
|
|
|
|
{
|
|
|
|
|
dto.ImageTags = new Dictionary<ImageType, string>();
|
|
|
|
|
dto.ImageTags = [];
|
|
|
|
|
|
|
|
|
|
// Prevent implicitly captured closure
|
|
|
|
|
var currentItem = item;
|
|
|
|
|