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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
var type = image.Key;
|
||||
|
||||
dto.ImageTags[type] = Kernel.Instance.ImageManager.GetImageCacheTag(item, type, image.Value);
|
||||
}
|
||||
dto.ImageTags[type] = Kernel.Instance.ImageManager.GetImageCacheTag(item, type, image.Value);
|
||||
}
|
||||
|
||||
dto.Id = GetClientItemId(item);
|
||||
|
|
|
@ -86,11 +86,6 @@ namespace MediaBrowser.Providers
|
|||
/// <param name="item">The item.</param>
|
||||
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
|
||||
var deletedKeys = item.Images.ToList().Where(image =>
|
||||
{
|
||||
|
|
|
@ -125,22 +125,11 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
|||
/// <returns>IEnumerable{System.String}.</returns>
|
||||
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.Images.Values);
|
||||
}
|
||||
images = images.Concat(item.BackdropImagePaths);
|
||||
|
||||
if (item.BackdropImagePaths != null)
|
||||
{
|
||||
images = images.Concat(item.BackdropImagePaths);
|
||||
}
|
||||
|
||||
if (item.ScreenshotImagePaths != null)
|
||||
{
|
||||
images = images.Concat(item.ScreenshotImagePaths);
|
||||
}
|
||||
images = images.Concat(item.ScreenshotImagePaths);
|
||||
|
||||
var localTrailers = _itemRepo.GetItems(item.LocalTrailerIds).ToList();
|
||||
images = localTrailers.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
||||
|
@ -162,8 +151,8 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
|
|||
|
||||
if (movie != null)
|
||||
{
|
||||
var specialFeattures = _itemRepo.GetItems(movie.SpecialFeatureIds).ToList();
|
||||
images = specialFeattures.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
||||
var specialFeatures = _itemRepo.GetItems(movie.SpecialFeatureIds).ToList();
|
||||
images = specialFeatures.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
|
||||
}
|
||||
|
||||
return images;
|
||||
|
|
Loading…
Reference in New Issue
Block a user