From 7071cf829ac3f55702a3399497d1faef627c70cd Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 22 Jan 2012 22:43:11 -0800 Subject: [PATCH] Updated diskprovider to use GetFiles instead of EnumerateFiles to prevent a screwed up issue. --- NzbDrone.Common/DiskProvider.cs | 8 ++++---- .../ProcessDownloadProviderFixture.cs | 2 +- .../UpdateProviderTests/GetUpdateLogFixture.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Common/DiskProvider.cs b/NzbDrone.Common/DiskProvider.cs index 545d2ecea..4322f3d0d 100644 --- a/NzbDrone.Common/DiskProvider.cs +++ b/NzbDrone.Common/DiskProvider.cs @@ -52,14 +52,14 @@ namespace NzbDrone.Common return File.Exists(path); } - public virtual IEnumerable GetDirectories(string path) + public virtual string[] GetDirectories(string path) { - return Directory.EnumerateDirectories(path); + return Directory.GetDirectories(path); } - public virtual IEnumerable GetFiles(string path, SearchOption searchOption) + public virtual string[] GetFiles(string path, SearchOption searchOption) { - return Directory.EnumerateFiles(path, "*.*", searchOption); + return Directory.GetFiles(path, "*.*", searchOption); } public virtual long GetDirectorySize(string path) diff --git a/NzbDrone.Core.Test/ProviderTests/PostDownloadProviderTests/ProcessDownloadProviderFixture.cs b/NzbDrone.Core.Test/ProviderTests/PostDownloadProviderTests/ProcessDownloadProviderFixture.cs index 9c2b465dc..3e93a4493 100644 --- a/NzbDrone.Core.Test/ProviderTests/PostDownloadProviderTests/ProcessDownloadProviderFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/PostDownloadProviderTests/ProcessDownloadProviderFixture.cs @@ -267,7 +267,7 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests [Test] public void ProcessDropFolder_should_only_process_folders_that_arent_known_series_folders() { - var subFolders = new List + var subFolders = new [] { @"c:\drop\episode1", @"c:\drop\episode2", diff --git a/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs b/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs index 7b7a44875..3bd737abf 100644 --- a/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs +++ b/NzbDrone.Core.Test/ProviderTests/UpdateProviderTests/GetUpdateLogFixture.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.ProviderTests.UpdateProviderTests Mocker.GetMock() .Setup(c => c.GetFiles(UpdateLogFolder, SearchOption.TopDirectoryOnly)) - .Returns(new List + .Returns(new [] { "C:\\nzbdrone\\update\\2011.09.20-19-08.txt", "C:\\nzbdrone\\update\\2011.10.20-20-08.txt",