mirror of https://github.com/Sonarr/Sonarr
Fixed: TheTVDB metadata images containing html content
This commit is contained in:
parent
25b763a052
commit
87a64cdacb
|
@ -249,6 +249,11 @@ namespace NzbDrone.Common.Http
|
||||||
var request = new HttpRequest(url);
|
var request = new HttpRequest(url);
|
||||||
request.ResponseStream = fileStream;
|
request.ResponseStream = fileStream;
|
||||||
var response = Get(request);
|
var response = Get(request);
|
||||||
|
|
||||||
|
if (response.Headers.ContentType != null && response.Headers.ContentType.Contains("text/html"))
|
||||||
|
{
|
||||||
|
throw new HttpException(request, response, "Site responded with html content.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stopWatch.Stop();
|
stopWatch.Stop();
|
||||||
if (File.Exists(fileName))
|
if (File.Exists(fileName))
|
||||||
|
|
|
@ -450,6 +450,10 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||||
}
|
}
|
||||||
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
||||||
}
|
}
|
||||||
|
catch (HttpException ex)
|
||||||
|
{
|
||||||
|
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, series, ex.Message);
|
||||||
|
}
|
||||||
catch (WebException ex)
|
catch (WebException ex)
|
||||||
{
|
{
|
||||||
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, series, ex.Message);
|
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, series, ex.Message);
|
||||||
|
|
|
@ -122,6 +122,10 @@ namespace NzbDrone.Core.MediaCover
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (HttpException e)
|
||||||
|
{
|
||||||
|
_logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message);
|
||||||
|
}
|
||||||
catch (WebException e)
|
catch (WebException e)
|
||||||
{
|
{
|
||||||
_logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message);
|
_logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message);
|
||||||
|
|
Loading…
Reference in New Issue