Fixed a bug in DiskProvider where it wouldn't copy subfolders properly.

This commit is contained in:
kay.one 2011-11-13 20:05:33 -08:00
commit ecbf127321
2 changed files with 18 additions and 9 deletions

View file

@ -67,7 +67,12 @@ namespace NzbDrone.Common
targetFolder.Create();
}
foreach (var file in sourceFolder.GetFiles("*.*", SearchOption.AllDirectories))
foreach (var subDir in sourceFolder.GetDirectories())
{
CopyDirectory(subDir.FullName, Path.Combine(target, subDir.Name));
}
foreach (var file in sourceFolder.GetFiles("*.*", SearchOption.TopDirectoryOnly))
{
var destFile = Path.Combine(target, file.Name);
file.CopyTo(destFile, true);