aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-20 01:36:22 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-20 01:36:22 -0400
commit549f82695063731209591042102b2aa2dd05cd51 (patch)
tree9994ee00f1b5a053c4ae09e041dd175d0f1c2775
parent2f47265c4f945e6712fccc367a18a36ce3123fac (diff)
catch 404's on requests to banners.xml
-rw-r--r--MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs28
1 files changed, 21 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs
index 28205c650..1e126de14 100644
--- a/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs
+++ b/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs
@@ -360,16 +360,30 @@ namespace MediaBrowser.Controller.Providers.TV
string url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TvdbApiKey + "/series/{0}/banners.xml", seriesId);
var images = new XmlDocument();
- using (var imgs = await HttpClient.Get(new HttpRequestOptions
+ try
{
- Url = url,
- ResourcePool = TvDbResourcePool,
- CancellationToken = cancellationToken,
- EnableResponseCache = true
+ using (var imgs = await HttpClient.Get(new HttpRequestOptions
+ {
+ Url = url,
+ ResourcePool = TvDbResourcePool,
+ CancellationToken = cancellationToken,
+ EnableResponseCache = true
- }).ConfigureAwait(false))
+ }).ConfigureAwait(false))
+ {
+ images.Load(imgs);
+ }
+ }
+ catch (HttpException ex)
{
- images.Load(imgs);
+ if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.NotFound)
+ {
+ // If a series has no images this will produce a 404.
+ // Return gracefully so we don't keep retrying on subsequent scans
+ return;
+ }
+
+ throw;
}
if (images.HasChildNodes)