diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-20 01:36:22 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-20 01:36:22 -0400 |
| commit | 549f82695063731209591042102b2aa2dd05cd51 (patch) | |
| tree | 9994ee00f1b5a053c4ae09e041dd175d0f1c2775 | |
| parent | 2f47265c4f945e6712fccc367a18a36ce3123fac (diff) | |
catch 404's on requests to banners.xml
| -rw-r--r-- | MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs | 28 |
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) |
