fix wrong season banners getting downloaded

This commit is contained in:
Luke Pulverenti 2013-10-27 18:19:23 -04:00
parent fed320f322
commit c2228c9a7f
1 changed files with 21 additions and 3 deletions

View File

@ -275,6 +275,7 @@ namespace MediaBrowser.Providers.TV
string url = null; string url = null;
int? bannerSeason = null; int? bannerSeason = null;
string resolution = null; string resolution = null;
string language = null;
while (reader.Read()) while (reader.Read())
{ {
@ -282,6 +283,12 @@ namespace MediaBrowser.Providers.TV
{ {
switch (reader.Name) switch (reader.Name)
{ {
case "Language":
{
language = reader.ReadElementContentAsString() ?? string.Empty;
break;
}
case "BannerType": case "BannerType":
{ {
bannerType = reader.ReadElementContentAsString() ?? string.Empty; bannerType = reader.ReadElementContentAsString() ?? string.Empty;
@ -333,10 +340,21 @@ namespace MediaBrowser.Providers.TV
} }
else if (string.Equals(bannerType2, "seasonwide", StringComparison.OrdinalIgnoreCase)) else if (string.Equals(bannerType2, "seasonwide", StringComparison.OrdinalIgnoreCase))
{ {
// Just grab the first if (string.IsNullOrWhiteSpace(language) || string.Equals(language, "en", StringComparison.OrdinalIgnoreCase))
if (string.IsNullOrWhiteSpace(data.Banner))
{ {
data.Banner = url; // Just grab the first
if (string.IsNullOrWhiteSpace(data.Banner))
{
data.Banner = url;
}
}
else if (string.Equals(language, ConfigurationManager.Configuration.PreferredMetadataLanguage, StringComparison.OrdinalIgnoreCase))
{
// Just grab the first
if (string.IsNullOrWhiteSpace(data.LanguageBanner))
{
data.LanguageBanner = url;
}
} }
} }
} }