fix tvdb providers grabbing last poster

This commit is contained in:
Luke Pulverenti 2013-10-26 00:12:20 -04:00
parent b487794860
commit a4a3800de5
2 changed files with 22 additions and 6 deletions

View File

@ -324,14 +324,22 @@ namespace MediaBrowser.Providers.TV
if (string.Equals(bannerType, "season", StringComparison.OrdinalIgnoreCase))
{
if (string.Equals(bannerType2, "season", StringComparison.OrdinalIgnoreCase))
{
// Just grab the first
if (string.IsNullOrWhiteSpace(data.Poster))
{
data.Poster = url;
}
}
else if (string.Equals(bannerType2, "seasonwide", StringComparison.OrdinalIgnoreCase))
{
// Just grab the first
if (string.IsNullOrWhiteSpace(data.Banner))
{
data.Banner = url;
}
}
}
else if (string.Equals(bannerType, "fanart", StringComparison.OrdinalIgnoreCase))
{
data.Backdrops.Add(new ImageInfo

View File

@ -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;
@ -372,13 +372,21 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrEmpty(url))
{
if (string.Equals(type, "poster", StringComparison.OrdinalIgnoreCase))
{
// Just grab the first
if (string.IsNullOrWhiteSpace(data.Poster))
{
data.Poster = url;
}
}
else if (string.Equals(type, "series", StringComparison.OrdinalIgnoreCase))
{
// Just grab the first
if (string.IsNullOrWhiteSpace(data.Banner))
{
data.Banner = url;
}
}
else if (string.Equals(type, "fanart", StringComparison.OrdinalIgnoreCase))
{
data.Backdrops.Add(new ImageInfo