From 30d6e2cd6ce0702faaec73b7ffb59d9844fb6967 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 15 Apr 2013 11:10:12 -0400 Subject: made library scan a bit more conservative --- .../Controls/ItemUpdateNotification.xaml.cs | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs') diff --git a/MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs b/MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs index 1f224f24d..30e39f6b0 100644 --- a/MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs +++ b/MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs @@ -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 } } + /// + /// Gets the image path. + /// + /// The item. + /// System.String. + 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; + } + /// /// Displays the rating. /// -- cgit v1.2.3