|
|
|
@ -6,14 +6,14 @@ using System.Globalization;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Jellyfin.Data.Entities;
|
|
|
|
|
using Jellyfin.Data.Enums;
|
|
|
|
|
using MediaBrowser.Common;
|
|
|
|
|
using MediaBrowser.Controller.Channels;
|
|
|
|
|
using MediaBrowser.Controller.Drawing;
|
|
|
|
|
using MediaBrowser.Controller.Dto;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using MediaBrowser.Controller.Entities.Audio;
|
|
|
|
|
using MediaBrowser.Controller.Entities.Movies;
|
|
|
|
|
using MediaBrowser.Controller.Entities.TV;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
|
using MediaBrowser.Controller.LiveTv;
|
|
|
|
|
using MediaBrowser.Controller.Persistence;
|
|
|
|
@ -24,12 +24,20 @@ using MediaBrowser.Model.Dto;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using MediaBrowser.Model.Querying;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Book = MediaBrowser.Controller.Entities.Book;
|
|
|
|
|
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
|
|
|
|
|
using Movie = MediaBrowser.Controller.Entities.Movies.Movie;
|
|
|
|
|
using MusicAlbum = MediaBrowser.Controller.Entities.Audio.MusicAlbum;
|
|
|
|
|
using Person = MediaBrowser.Controller.Entities.Person;
|
|
|
|
|
using Photo = MediaBrowser.Controller.Entities.Photo;
|
|
|
|
|
using Season = MediaBrowser.Controller.Entities.TV.Season;
|
|
|
|
|
using Series = MediaBrowser.Controller.Entities.TV.Series;
|
|
|
|
|
|
|
|
|
|
namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
public class DtoService : IDtoService
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
private readonly ILogger<DtoService> _logger;
|
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
|
private readonly IUserDataManager _userDataRepository;
|
|
|
|
|
private readonly IItemRepository _itemRepo;
|
|
|
|
@ -66,7 +74,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Converts a BaseItem to a DTOBaseItem
|
|
|
|
|
/// Converts a BaseItem to a DTOBaseItem.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="fields">The fields.</param>
|
|
|
|
@ -269,6 +277,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
dto.EpisodeTitle = dto.Name;
|
|
|
|
|
dto.Name = dto.SeriesName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
liveTvManager.AddInfoToRecordingDto(item, dto, activeRecording, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -284,6 +293,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var containers = container.Split(new[] { ',' });
|
|
|
|
|
if (containers.Length < 2)
|
|
|
|
|
{
|
|
|
|
@ -384,7 +394,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (options.ContainsField(ItemFields.ChildCount))
|
|
|
|
|
{
|
|
|
|
|
dto.ChildCount = dto.ChildCount ?? GetChildCount(folder, user);
|
|
|
|
|
dto.ChildCount ??= GetChildCount(folder, user);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -398,7 +408,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
dto.DateLastMediaAdded = folder.DateLastMediaAdded;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (options.EnableUserData)
|
|
|
|
@ -414,7 +423,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (options.ContainsField(ItemFields.BasicSyncInfo))
|
|
|
|
|
{
|
|
|
|
|
var userCanSync = user != null && user.Policy.EnableContentDownloading;
|
|
|
|
|
var userCanSync = user != null && user.HasPermission(PermissionKind.EnableContentDownloading);
|
|
|
|
|
if (userCanSync && item.SupportsExternalTransfer)
|
|
|
|
|
{
|
|
|
|
|
dto.SupportsSync = true;
|
|
|
|
@ -435,7 +444,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets client-side Id of a server-side BaseItem
|
|
|
|
|
/// Gets client-side Id of a server-side BaseItem.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
@ -449,6 +458,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
dto.SeriesName = item.SeriesName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void SetPhotoProperties(BaseItemDto dto, Photo item)
|
|
|
|
|
{
|
|
|
|
|
dto.CameraMake = item.CameraMake;
|
|
|
|
@ -530,7 +540,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attaches People DTO's to a DTOBaseItem
|
|
|
|
|
/// Attaches People DTO's to a DTOBaseItem.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dto">The dto.</param>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
@ -547,22 +557,27 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i.IsType(PersonType.GuestStar))
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i.IsType(PersonType.Director))
|
|
|
|
|
{
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i.IsType(PersonType.Writer))
|
|
|
|
|
{
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i.IsType(PersonType.Producer))
|
|
|
|
|
{
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i.IsType(PersonType.Composer))
|
|
|
|
|
{
|
|
|
|
|
return 4;
|
|
|
|
@ -586,7 +601,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
_logger.LogError(ex, "Error getting person {Name}", c);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).Where(i => i != null)
|
|
|
|
|
.GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
|
|
|
|
|
.Select(x => x.First())
|
|
|
|
@ -605,8 +619,9 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
if (dictionary.TryGetValue(person.Name, out Person entity))
|
|
|
|
|
{
|
|
|
|
|
baseItemPerson.PrimaryImageTag = GetImageCacheTag(entity, ImageType.Primary);
|
|
|
|
|
baseItemPerson.PrimaryImageTag = GetTagAndFillBlurhash(dto, entity, ImageType.Primary);
|
|
|
|
|
baseItemPerson.Id = entity.Id.ToString("N", CultureInfo.InvariantCulture);
|
|
|
|
|
baseItemPerson.ImageBlurHashes = dto.ImageBlurHashes;
|
|
|
|
|
list.Add(baseItemPerson);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -654,8 +669,72 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
return _libraryManager.GetGenreId(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ImageType imageType, int imageIndex = 0)
|
|
|
|
|
{
|
|
|
|
|
var image = item.GetImageInfo(imageType, imageIndex);
|
|
|
|
|
if (image != null)
|
|
|
|
|
{
|
|
|
|
|
return GetTagAndFillBlurhash(dto, item, image);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ItemImageInfo image)
|
|
|
|
|
{
|
|
|
|
|
var tag = GetImageCacheTag(item, image);
|
|
|
|
|
if (!string.IsNullOrEmpty(image.BlurHash))
|
|
|
|
|
{
|
|
|
|
|
if (dto.ImageBlurHashes == null)
|
|
|
|
|
{
|
|
|
|
|
dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!dto.ImageBlurHashes.ContainsKey(image.Type))
|
|
|
|
|
{
|
|
|
|
|
dto.ImageBlurHashes[image.Type] = new Dictionary<string, string>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto.ImageBlurHashes[image.Type][tag] = image.BlurHash;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return tag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string[] GetTagsAndFillBlurhashes(BaseItemDto dto, BaseItem item, ImageType imageType, int limit)
|
|
|
|
|
{
|
|
|
|
|
return GetTagsAndFillBlurhashes(dto, item, imageType, item.GetImages(imageType).Take(limit).ToList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string[] GetTagsAndFillBlurhashes(BaseItemDto dto, BaseItem item, ImageType imageType, List<ItemImageInfo> images)
|
|
|
|
|
{
|
|
|
|
|
var tags = GetImageTags(item, images);
|
|
|
|
|
var hashes = new Dictionary<string, string>();
|
|
|
|
|
for (int i = 0; i < images.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var img = images[i];
|
|
|
|
|
if (!string.IsNullOrEmpty(img.BlurHash))
|
|
|
|
|
{
|
|
|
|
|
var tag = tags[i];
|
|
|
|
|
hashes[tag] = img.BlurHash;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hashes.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
if (dto.ImageBlurHashes == null)
|
|
|
|
|
{
|
|
|
|
|
dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto.ImageBlurHashes[imageType] = hashes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return tags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets simple property values on a DTOBaseItem
|
|
|
|
|
/// Sets simple property values on a DTOBaseItem.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dto">The dto.</param>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
@ -674,8 +753,8 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
dto.LockData = item.IsLocked;
|
|
|
|
|
dto.ForcedSortName = item.ForcedSortName;
|
|
|
|
|
}
|
|
|
|
|
dto.Container = item.Container;
|
|
|
|
|
|
|
|
|
|
dto.Container = item.Container;
|
|
|
|
|
dto.EndDate = item.EndDate;
|
|
|
|
|
|
|
|
|
|
if (options.ContainsField(ItemFields.ExternalUrls))
|
|
|
|
@ -694,10 +773,12 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
dto.AspectRatio = hasAspectRatio.AspectRatio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
|
|
|
|
|
|
|
|
|
|
var backdropLimit = options.GetImageLimit(ImageType.Backdrop);
|
|
|
|
|
if (backdropLimit > 0)
|
|
|
|
|
{
|
|
|
|
|
dto.BackdropImageTags = GetImageTags(item, item.GetImages(ImageType.Backdrop).Take(backdropLimit).ToList());
|
|
|
|
|
dto.BackdropImageTags = GetTagsAndFillBlurhashes(dto, item, ImageType.Backdrop, backdropLimit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.ContainsField(ItemFields.ScreenshotImageTags))
|
|
|
|
@ -705,7 +786,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
var screenshotLimit = options.GetImageLimit(ImageType.Screenshot);
|
|
|
|
|
if (screenshotLimit > 0)
|
|
|
|
|
{
|
|
|
|
|
dto.ScreenshotImageTags = GetImageTags(item, item.GetImages(ImageType.Screenshot).Take(screenshotLimit).ToList());
|
|
|
|
|
dto.ScreenshotImageTags = GetTagsAndFillBlurhashes(dto, item, ImageType.Screenshot, screenshotLimit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -721,12 +802,11 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
// Prevent implicitly captured closure
|
|
|
|
|
var currentItem = item;
|
|
|
|
|
foreach (var image in currentItem.ImageInfos.Where(i => !currentItem.AllowsMultipleImages(i.Type))
|
|
|
|
|
.ToList())
|
|
|
|
|
foreach (var image in currentItem.ImageInfos.Where(i => !currentItem.AllowsMultipleImages(i.Type)))
|
|
|
|
|
{
|
|
|
|
|
if (options.GetImageLimit(image.Type) > 0)
|
|
|
|
|
{
|
|
|
|
|
var tag = GetImageCacheTag(item, image);
|
|
|
|
|
var tag = GetTagAndFillBlurhash(dto, item, image);
|
|
|
|
|
|
|
|
|
|
if (tag != null)
|
|
|
|
|
{
|
|
|
|
@ -871,11 +951,10 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (albumParent != null)
|
|
|
|
|
{
|
|
|
|
|
dto.AlbumId = albumParent.Id;
|
|
|
|
|
|
|
|
|
|
dto.AlbumPrimaryImageTag = GetImageCacheTag(albumParent, ImageType.Primary);
|
|
|
|
|
dto.AlbumPrimaryImageTag = GetTagAndFillBlurhash(dto, albumParent, ImageType.Primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (options.ContainsField(ItemFields.MediaSourceCount))
|
|
|
|
|
// if (options.ContainsField(ItemFields.MediaSourceCount))
|
|
|
|
|
//{
|
|
|
|
|
// Songs always have one
|
|
|
|
|
//}
|
|
|
|
@ -885,13 +964,13 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
dto.Artists = hasArtist.Artists;
|
|
|
|
|
|
|
|
|
|
//var artistItems = _libraryManager.GetArtists(new InternalItemsQuery
|
|
|
|
|
// var artistItems = _libraryManager.GetArtists(new InternalItemsQuery
|
|
|
|
|
//{
|
|
|
|
|
// EnableTotalRecordCount = false,
|
|
|
|
|
// ItemIds = new[] { item.Id.ToString("N", CultureInfo.InvariantCulture) }
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
//dto.ArtistItems = artistItems.Items
|
|
|
|
|
// dto.ArtistItems = artistItems.Items
|
|
|
|
|
// .Select(i =>
|
|
|
|
|
// {
|
|
|
|
|
// var artist = i.Item1;
|
|
|
|
@ -904,7 +983,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
// .ToList();
|
|
|
|
|
|
|
|
|
|
// Include artists that are not in the database yet, e.g., just added via metadata editor
|
|
|
|
|
//var foundArtists = artistItems.Items.Select(i => i.Item1.Name).ToList();
|
|
|
|
|
// var foundArtists = artistItems.Items.Select(i => i.Item1.Name).ToList();
|
|
|
|
|
dto.ArtistItems = hasArtist.Artists
|
|
|
|
|
//.Except(foundArtists, new DistinctNameComparer())
|
|
|
|
|
.Select(i =>
|
|
|
|
@ -929,7 +1008,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}).Where(i => i != null).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -938,13 +1016,13 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
{
|
|
|
|
|
dto.AlbumArtist = hasAlbumArtist.AlbumArtists.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
//var artistItems = _libraryManager.GetAlbumArtists(new InternalItemsQuery
|
|
|
|
|
// var artistItems = _libraryManager.GetAlbumArtists(new InternalItemsQuery
|
|
|
|
|
//{
|
|
|
|
|
// EnableTotalRecordCount = false,
|
|
|
|
|
// ItemIds = new[] { item.Id.ToString("N", CultureInfo.InvariantCulture) }
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
//dto.AlbumArtists = artistItems.Items
|
|
|
|
|
// dto.AlbumArtists = artistItems.Items
|
|
|
|
|
// .Select(i =>
|
|
|
|
|
// {
|
|
|
|
|
// var artist = i.Item1;
|
|
|
|
@ -980,7 +1058,6 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}).Where(i => i != null).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1094,12 +1171,12 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
// this block will add the series poster for episodes without a poster
|
|
|
|
|
// TODO maybe remove the if statement entirely
|
|
|
|
|
//if (options.ContainsField(ItemFields.SeriesPrimaryImage))
|
|
|
|
|
// if (options.ContainsField(ItemFields.SeriesPrimaryImage))
|
|
|
|
|
{
|
|
|
|
|
episodeSeries = episodeSeries ?? episode.Series;
|
|
|
|
|
if (episodeSeries != null)
|
|
|
|
|
{
|
|
|
|
|
dto.SeriesPrimaryImageTag = GetImageCacheTag(episodeSeries, ImageType.Primary);
|
|
|
|
|
dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, episodeSeries, ImageType.Primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1140,12 +1217,12 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
// this block will add the series poster for seasons without a poster
|
|
|
|
|
// TODO maybe remove the if statement entirely
|
|
|
|
|
//if (options.ContainsField(ItemFields.SeriesPrimaryImage))
|
|
|
|
|
// if (options.ContainsField(ItemFields.SeriesPrimaryImage))
|
|
|
|
|
{
|
|
|
|
|
series = series ?? season.Series;
|
|
|
|
|
if (series != null)
|
|
|
|
|
{
|
|
|
|
|
dto.SeriesPrimaryImageTag = GetImageCacheTag(series, ImageType.Primary);
|
|
|
|
|
dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, series, ImageType.Primary);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1275,9 +1352,10 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (image != null)
|
|
|
|
|
{
|
|
|
|
|
dto.ParentLogoItemId = GetDtoId(parent);
|
|
|
|
|
dto.ParentLogoImageTag = GetImageCacheTag(parent, image);
|
|
|
|
|
dto.ParentLogoImageTag = GetTagAndFillBlurhash(dto, parent, image);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (artLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Art)) && dto.ParentArtItemId == null)
|
|
|
|
|
{
|
|
|
|
|
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Art);
|
|
|
|
@ -1285,9 +1363,10 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (image != null)
|
|
|
|
|
{
|
|
|
|
|
dto.ParentArtItemId = GetDtoId(parent);
|
|
|
|
|
dto.ParentArtImageTag = GetImageCacheTag(parent, image);
|
|
|
|
|
dto.ParentArtImageTag = GetTagAndFillBlurhash(dto, parent, image);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (thumbLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Thumb)) && (dto.ParentThumbItemId == null || parent is Series) && !(parent is ICollectionFolder) && !(parent is UserView))
|
|
|
|
|
{
|
|
|
|
|
var image = allImages.FirstOrDefault(i => i.Type == ImageType.Thumb);
|
|
|
|
@ -1295,9 +1374,10 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (image != null)
|
|
|
|
|
{
|
|
|
|
|
dto.ParentThumbItemId = GetDtoId(parent);
|
|
|
|
|
dto.ParentThumbImageTag = GetImageCacheTag(parent, image);
|
|
|
|
|
dto.ParentThumbImageTag = GetTagAndFillBlurhash(dto, parent, image);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (backdropLimit > 0 && !((dto.BackdropImageTags != null && dto.BackdropImageTags.Length > 0) || (dto.ParentBackdropImageTags != null && dto.ParentBackdropImageTags.Length > 0)))
|
|
|
|
|
{
|
|
|
|
|
var images = allImages.Where(i => i.Type == ImageType.Backdrop).Take(backdropLimit).ToList();
|
|
|
|
@ -1305,7 +1385,7 @@ namespace Emby.Server.Implementations.Dto
|
|
|
|
|
if (images.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dto.ParentBackdropItemId = GetDtoId(parent);
|
|
|
|
|
dto.ParentBackdropImageTags = GetImageTags(parent, images);
|
|
|
|
|
dto.ParentBackdropImageTags = GetTagsAndFillBlurhashes(dto, parent, ImageType.Backdrop, images);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|