diff --git a/src/.idea/.idea.NzbDrone/.idea/encodings.xml b/src/.idea/.idea.NzbDrone/.idea/encodings.xml new file mode 100644 index 000000000..15a15b218 --- /dev/null +++ b/src/.idea/.idea.NzbDrone/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/.idea/.idea.NzbDrone/.idea/misc.xml b/src/.idea/.idea.NzbDrone/.idea/misc.xml new file mode 100644 index 000000000..1d8c84d0a --- /dev/null +++ b/src/.idea/.idea.NzbDrone/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index 8b888e1ce..aaae3f032 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -123,27 +123,6 @@ namespace NzbDrone.Common.Disk } } - public bool IsValidGDIPlusImage(string filename) - { - if (!CanUseGDIPlus()) - { - return true; - } - - try - { - using (var bmp = new Bitmap(filename)) - { - } - return true; - } - catch (Exception ex) - { - Logger.Debug(ex, "Corrupted image found at: {0}.", filename); - return false; - } - } - public bool FolderWritable(string path) { Ensure.That(path, () => path).IsValidPath(); diff --git a/src/NzbDrone.Common/Disk/IDiskProvider.cs b/src/NzbDrone.Common/Disk/IDiskProvider.cs index 33e8d0228..52b1fa4f0 100644 --- a/src/NzbDrone.Common/Disk/IDiskProvider.cs +++ b/src/NzbDrone.Common/Disk/IDiskProvider.cs @@ -20,7 +20,6 @@ namespace NzbDrone.Common.Disk bool FileExists(string path); bool FileExists(string path, StringComparison stringComparison); bool CanUseGDIPlus(); - bool IsValidGDIPlusImage(string path); bool FolderWritable(string path); string[] GetDirectories(string path); string[] GetFiles(string path, SearchOption searchOption); diff --git a/src/NzbDrone.Core.Test/MediaCoverTests/CoverExistsSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaCoverTests/CoverExistsSpecificationFixture.cs index 9b6add7ba..26d427d61 100644 --- a/src/NzbDrone.Core.Test/MediaCoverTests/CoverExistsSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/MediaCoverTests/CoverExistsSpecificationFixture.cs @@ -37,15 +37,6 @@ namespace NzbDrone.Core.Test.MediaCoverTests } - private void GivenImageFileCorrupt(bool corrupt) - { - GivenFileExistsOnDisk(); - Mocker.GetMock() - .Setup(c => c.IsValidGDIPlusImage(It.IsAny())) - .Returns(!corrupt); - } - - [Test] public void should_return_false_if_file_not_exists() { @@ -61,21 +52,11 @@ namespace NzbDrone.Core.Test.MediaCoverTests Subject.AlreadyExists("http://url", "c:\\file.exe").Should().BeFalse(); } - [Test] - public void should_return_false_if_file_exists_and_same_size_and_corrupt() - { - GivenExistingFileSize(100); - GivenImageFileCorrupt(true); - _httpResponse.Headers.ContentLength = 100; - Subject.AlreadyExists("http://url", "c:\\file.exe").Should().BeFalse(); - } - [Test] public void should_return_true_if_file_exists_and_same_size_and_not_corrupt() { GivenExistingFileSize(100); - GivenImageFileCorrupt(false); _httpResponse.Headers.ContentLength = 100; Subject.AlreadyExists("http://url", "c:\\file.exe").Should().BeTrue(); } diff --git a/src/NzbDrone.Core/MediaCover/CoverAlreadyExistsSpecification.cs b/src/NzbDrone.Core/MediaCover/CoverAlreadyExistsSpecification.cs index bb5b148a9..49e4f60de 100644 --- a/src/NzbDrone.Core/MediaCover/CoverAlreadyExistsSpecification.cs +++ b/src/NzbDrone.Core/MediaCover/CoverAlreadyExistsSpecification.cs @@ -31,12 +31,6 @@ namespace NzbDrone.Core.MediaCover return false; } - if (!_diskProvider.IsValidGDIPlusImage(path)) - { - _diskProvider.DeleteFile(path); - return false; - } - var headers = _httpClient.Head(new HttpRequest(url)).Headers; var fileSize = _diskProvider.GetFileSize(path); return fileSize == headers.ContentLength; diff --git a/src/NzbDrone.sln.DotSettings b/src/NzbDrone.sln.DotSettings index 53d134aab..1fecc101c 100644 --- a/src/NzbDrone.sln.DotSettings +++ b/src/NzbDrone.sln.DotSettings @@ -74,6 +74,7 @@ True True True + True True True True