made library scan a bit more conservative

This commit is contained in:
Luke Pulverenti
2013-04-15 11:10:12 -04:00
parent a4cac9c95d
commit 30d6e2cd6c
17 changed files with 677 additions and 592 deletions

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
@@ -159,7 +160,7 @@ namespace MediaBrowser.ServerApplication.Controls
DisplayTitle(item);
DisplayRating(item);
var path = MultiItemUpdateNotification.GetImagePath(item);
var path = GetImagePath(item);
if (string.IsNullOrEmpty(path))
{
@@ -210,6 +211,44 @@ namespace MediaBrowser.ServerApplication.Controls
}
}
/// <summary>
/// Gets the image path.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>System.String.</returns>
internal static string GetImagePath(BaseItem item)
{
// Try our best to find an image
var path = item.PrimaryImagePath;
if (string.IsNullOrEmpty(path) && item.BackdropImagePaths != null)
{
path = item.BackdropImagePaths.FirstOrDefault();
}
if (string.IsNullOrEmpty(path))
{
path = item.GetImage(ImageType.Thumb);
}
if (string.IsNullOrEmpty(path))
{
path = item.GetImage(ImageType.Art);
}
if (string.IsNullOrEmpty(path))
{
path = item.GetImage(ImageType.Logo);
}
if (string.IsNullOrEmpty(path))
{
path = item.GetImage(ImageType.Disc);
}
return path;
}
/// <summary>
/// Displays the rating.
/// </summary>