From a4a3800de56f8cb8185e95a9c343b74db0bbdcea Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 26 Oct 2013 00:12:20 -0400 Subject: [PATCH] fix tvdb providers grabbing last poster --- .../TV/RemoteSeasonProvider.cs | 12 ++++++++++-- .../TV/TvdbSeriesImageProvider.cs | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Providers/TV/RemoteSeasonProvider.cs b/MediaBrowser.Providers/TV/RemoteSeasonProvider.cs index c0ff760549..a5408c8dee 100644 --- a/MediaBrowser.Providers/TV/RemoteSeasonProvider.cs +++ b/MediaBrowser.Providers/TV/RemoteSeasonProvider.cs @@ -325,11 +325,19 @@ namespace MediaBrowser.Providers.TV { if (string.Equals(bannerType2, "season", StringComparison.OrdinalIgnoreCase)) { - data.Poster = url; + // Just grab the first + if (string.IsNullOrWhiteSpace(data.Poster)) + { + data.Poster = url; + } } else if (string.Equals(bannerType2, "seasonwide", StringComparison.OrdinalIgnoreCase)) { - data.Banner = url; + // Just grab the first + if (string.IsNullOrWhiteSpace(data.Banner)) + { + data.Banner = url; + } } } else if (string.Equals(bannerType, "fanart", StringComparison.OrdinalIgnoreCase)) diff --git a/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs index fa42257607..cc8e970400 100644 --- a/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbSeriesImageProvider.cs @@ -1,5 +1,4 @@ -using System.Linq; -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; @@ -11,6 +10,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -373,11 +373,19 @@ namespace MediaBrowser.Providers.TV { if (string.Equals(type, "poster", StringComparison.OrdinalIgnoreCase)) { - data.Poster = url; + // Just grab the first + if (string.IsNullOrWhiteSpace(data.Poster)) + { + data.Poster = url; + } } else if (string.Equals(type, "series", StringComparison.OrdinalIgnoreCase)) { - data.Banner = url; + // Just grab the first + if (string.IsNullOrWhiteSpace(data.Banner)) + { + data.Banner = url; + } } else if (string.Equals(type, "fanart", StringComparison.OrdinalIgnoreCase)) {