mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-11 09:13:54 -04:00
catch 404's on requests to banners.xml
This commit is contained in:
parent
2f47265c4f
commit
549f826950
@ -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);
|
string url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TvdbApiKey + "/series/{0}/banners.xml", seriesId);
|
||||||
var images = new XmlDocument();
|
var images = new XmlDocument();
|
||||||
|
|
||||||
using (var imgs = await HttpClient.Get(new HttpRequestOptions
|
try
|
||||||
{
|
{
|
||||||
Url = url,
|
using (var imgs = await HttpClient.Get(new HttpRequestOptions
|
||||||
ResourcePool = TvDbResourcePool,
|
{
|
||||||
CancellationToken = cancellationToken,
|
Url = url,
|
||||||
EnableResponseCache = true
|
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)
|
if (images.HasChildNodes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user