From a68c8820329ab1b3a8de46a512514e146b808bdf Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 22 Jan 2012 20:34:30 -0800 Subject: [PATCH] fixed http 500 error. --- NzbDrone.Common/DiskProvider.cs | 10 ++++++++++ NzbDrone.Core.Test/IndexerTests.cs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/NzbDrone.Common/DiskProvider.cs b/NzbDrone.Common/DiskProvider.cs index 6b25cd676..7c3fac8b6 100644 --- a/NzbDrone.Common/DiskProvider.cs +++ b/NzbDrone.Common/DiskProvider.cs @@ -24,6 +24,16 @@ namespace NzbDrone.Common private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); + public virtual DateTime GetLastDirectoryWrite(string path) + { + if (!FolderExists(path)) + { + throw new DirectoryNotFoundException("Directory doesn't exist. " + path); + } + + GetFiles(path, SearchOption.AllDirectories); + } + public virtual bool FolderExists(string path) { return Directory.Exists(path); diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 4d34b2669..b232933ec 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -179,6 +179,7 @@ namespace NzbDrone.Core.Test Mocker.Resolve().FetchRss(); Mark500Inconclusive(); + ExceptionVerification.IgnoreWarns(); } [TestCase("simpsons", 21, 23)] @@ -387,6 +388,7 @@ namespace NzbDrone.Core.Test { ExceptionVerification.MarkInconclusive(typeof(WebException)); ExceptionVerification.MarkInconclusive("System.Net.WebException"); + ExceptionVerification.MarkInconclusive("(503) Server Unavailable."); } } }