mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 05:30:46 +02:00
removed null checks that are no longer needed
This commit is contained in:
parent
b96ef2ffae
commit
7d411c3c91
|
@ -280,16 +280,13 @@ namespace MediaBrowser.Controller.Dto
|
||||||
dto.Genres = item.Genres;
|
dto.Genres = item.Genres;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Images != null)
|
dto.ImageTags = new Dictionary<ImageType, Guid>();
|
||||||
|
|
||||||
|
foreach (var image in item.Images)
|
||||||
{
|
{
|
||||||
dto.ImageTags = new Dictionary<ImageType, Guid>();
|
var type = image.Key;
|
||||||
|
|
||||||
foreach (var image in item.Images)
|
dto.ImageTags[type] = Kernel.Instance.ImageManager.GetImageCacheTag(item, type, image.Value);
|
||||||
{
|
|
||||||
var type = image.Key;
|
|
||||||
|
|
||||||
dto.ImageTags[type] = Kernel.Instance.ImageManager.GetImageCacheTag(item, type, image.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dto.Id = GetClientItemId(item);
|
dto.Id = GetClientItemId(item);
|
||||||
|
|
|
@ -86,11 +86,6 @@ namespace MediaBrowser.Providers
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
private void ValidateImages(BaseItem item)
|
private void ValidateImages(BaseItem item)
|
||||||
{
|
{
|
||||||
if (item.Images == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below
|
// Only validate paths from the same directory - need to copy to a list because we are going to potentially modify the collection below
|
||||||
var deletedKeys = item.Images.ToList().Where(image =>
|
var deletedKeys = item.Images.ToList().Where(image =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,22 +125,11 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
/// <returns>IEnumerable{System.String}.</returns>
|
/// <returns>IEnumerable{System.String}.</returns>
|
||||||
private IEnumerable<string> GetPathsInUse(BaseItem item)
|
private IEnumerable<string> GetPathsInUse(BaseItem item)
|
||||||
{
|
{
|
||||||
IEnumerable<string> images = new List<string>();
|
IEnumerable<string> images = item.Images.Values.ToList();
|
||||||
|
|
||||||
if (item.Images != null)
|
images = images.Concat(item.BackdropImagePaths);
|
||||||
{
|
|
||||||
images = images.Concat(item.Images.Values);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.BackdropImagePaths != null)
|
images = images.Concat(item.ScreenshotImagePaths);
|
||||||
{
|
|
||||||
images = images.Concat(item.BackdropImagePaths);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.ScreenshotImagePaths != null)
|
|
||||||
{
|
|
||||||
images = images.Concat(item.ScreenshotImagePaths);
|
|
||||||
}
|
|
||||||
|
|
||||||
var localTrailers = _itemRepo.GetItems(item.LocalTrailerIds).ToList();
|
var localTrailers = _itemRepo.GetItems(item.LocalTrailerIds).ToList();
|
||||||
images = localTrailers.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
images = localTrailers.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
||||||
|
@ -162,8 +151,8 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
||||||
|
|
||||||
if (movie != null)
|
if (movie != null)
|
||||||
{
|
{
|
||||||
var specialFeattures = _itemRepo.GetItems(movie.SpecialFeatureIds).ToList();
|
var specialFeatures = _itemRepo.GetItems(movie.SpecialFeatureIds).ToList();
|
||||||
images = specialFeattures.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
images = specialFeatures.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return images;
|
return images;
|
||||||
|
|
Loading…
Reference in a new issue