Updated diskprovider to use GetFiles instead of EnumerateFiles to prevent a screwed up issue.

This commit is contained in:
kay.one 2012-01-22 22:43:11 -08:00
parent ead5f37921
commit 7071cf829a
3 changed files with 6 additions and 6 deletions

View File

@ -52,14 +52,14 @@ namespace NzbDrone.Common
return File.Exists(path);
}
public virtual IEnumerable<string> GetDirectories(string path)
public virtual string[] GetDirectories(string path)
{
return Directory.EnumerateDirectories(path);
return Directory.GetDirectories(path);
}
public virtual IEnumerable<string> 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)

View File

@ -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<string>
var subFolders = new []
{
@"c:\drop\episode1",
@"c:\drop\episode2",

View File

@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test.ProviderTests.UpdateProviderTests
Mocker.GetMock<DiskProvider>()
.Setup(c => c.GetFiles(UpdateLogFolder, SearchOption.TopDirectoryOnly))
.Returns(new List<string>
.Returns(new []
{
"C:\\nzbdrone\\update\\2011.09.20-19-08.txt",
"C:\\nzbdrone\\update\\2011.10.20-20-08.txt",