diff options
Diffstat (limited to 'MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/Controls/ItemUpdateNotification.xaml.cs | 43 |
1 files changed, 41 insertions, 2 deletions
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)) { @@ -211,6 +212,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> /// <param name="item">The item.</param> |
