image cleanup fixes

pull/702/head
Luke Pulverenti 12 years ago
parent 56d7bbd78f
commit 6d3849d98d

@ -138,29 +138,33 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
images = images.Concat(item.ScreenshotImagePaths); images = images.Concat(item.ScreenshotImagePaths);
} }
var video = item as Video; if (item.LocalTrailers != null)
{
images = item.LocalTrailers.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
}
if (video != null && video.Chapters != null) if (item.ThemeSongs != null)
{ {
images = images.Concat(video.Chapters.Where(i => !string.IsNullOrEmpty(i.ImagePath)).Select(i => i.ImagePath)); images = item.ThemeSongs.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
} }
if (item.LocalTrailers != null) if (item.ThemeVideos != null)
{ {
foreach (var subItem in item.LocalTrailers) images = item.ThemeVideos.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
{ }
images = images.Concat(GetPathsInUse(subItem));
} var video = item as Video;
if (video != null && video.Chapters != null)
{
images = images.Concat(video.Chapters.Where(i => !string.IsNullOrEmpty(i.ImagePath)).Select(i => i.ImagePath));
} }
var movie = item as Movie; var movie = item as Movie;
if (movie != null && movie.SpecialFeatures != null) if (movie != null && movie.SpecialFeatures != null)
{ {
foreach (var subItem in movie.SpecialFeatures) images = movie.SpecialFeatures.Aggregate(images, (current, subItem) => current.Concat(GetPathsInUse(subItem)));
{
images = images.Concat(GetPathsInUse(subItem));
}
} }
return images; return images;

Loading…
Cancel
Save