From 9902889a30bb126de9c631a483bc70dc822f95ec Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 25 Jun 2020 23:40:37 +0200 Subject: [PATCH] Fixed metadata images containing html content (cherry picked from commit 87a64cdacbb0945c89b878d02a7eb2ac28427026) --- src/NzbDrone.Core/Extras/Metadata/MetadataService.cs | 4 ++++ src/NzbDrone.Core/MediaCover/MediaCoverService.cs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs b/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs index 63aff7d53..81d435f00 100644 --- a/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs +++ b/src/NzbDrone.Core/Extras/Metadata/MetadataService.cs @@ -368,6 +368,10 @@ namespace NzbDrone.Core.Extras.Metadata _mediaFileAttributeService.SetFilePermissions(fullPath); } } + catch (HttpException ex) + { + _logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, author, ex.Message); + } catch (WebException ex) { _logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, author, ex.Message); diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs index 6d03053e3..638309e42 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -143,6 +143,10 @@ namespace NzbDrone.Core.MediaCover DownloadCover(author, cover, serverFileHeaders.LastModified ?? DateTime.Now); } } + catch (HttpException e) + { + _logger.Warn("Couldn't download media cover for {0}. {1}", author, e.Message); + } catch (WebException e) { _logger.Warn("Couldn't download media cover for {0}. {1}", author, e.Message); @@ -193,6 +197,10 @@ namespace NzbDrone.Core.MediaCover DownloadBookCover(book, cover, serverFileHeaders.LastModified ?? DateTime.Now); } } + catch (HttpException e) + { + _logger.Warn("Couldn't download media cover for {0}. {1}", book, e.Message); + } catch (WebException e) { _logger.Warn("Couldn't download media cover for {0}. {1}", book, e.Message);