mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
@@ -84,14 +84,20 @@ namespace NzbDrone.Common.Disk
|
||||
|
||||
foreach (var subDir in _diskProvider.GetDirectoryInfos(sourcePath))
|
||||
{
|
||||
if (ShouldIgnore(subDir)) continue;
|
||||
if (ShouldIgnore(subDir))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
result &= TransferFolder(subDir.FullName, Path.Combine(targetPath, subDir.Name), mode, verificationMode);
|
||||
}
|
||||
|
||||
foreach (var sourceFile in _diskProvider.GetFileInfos(sourcePath))
|
||||
{
|
||||
if (ShouldIgnore(sourceFile)) continue;
|
||||
if (ShouldIgnore(sourceFile))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var destFile = Path.Combine(targetPath, sourceFile.Name);
|
||||
|
||||
@@ -125,14 +131,20 @@ namespace NzbDrone.Common.Disk
|
||||
|
||||
foreach (var subDir in targetFolders.Where(v => !sourceFolders.Any(d => d.Name == v.Name)))
|
||||
{
|
||||
if (ShouldIgnore(subDir)) continue;
|
||||
if (ShouldIgnore(subDir))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
_diskProvider.DeleteFolder(subDir.FullName, true);
|
||||
}
|
||||
|
||||
foreach (var subDir in sourceFolders)
|
||||
{
|
||||
if (ShouldIgnore(subDir)) continue;
|
||||
if (ShouldIgnore(subDir))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
filesCopied += MirrorFolder(subDir.FullName, Path.Combine(targetPath, subDir.Name));
|
||||
}
|
||||
@@ -142,14 +154,20 @@ namespace NzbDrone.Common.Disk
|
||||
|
||||
foreach (var targetFile in targetFiles.Where(v => !sourceFiles.Any(d => d.Name == v.Name)))
|
||||
{
|
||||
if (ShouldIgnore(targetFile)) continue;
|
||||
if (ShouldIgnore(targetFile))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
_diskProvider.DeleteFile(targetFile.FullName);
|
||||
}
|
||||
|
||||
foreach (var sourceFile in sourceFiles)
|
||||
{
|
||||
if (ShouldIgnore(sourceFile)) continue;
|
||||
if (ShouldIgnore(sourceFile))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var targetFile = Path.Combine(targetPath, sourceFile.Name);
|
||||
|
||||
@@ -282,6 +300,7 @@ namespace NzbDrone.Common.Disk
|
||||
{
|
||||
return TransferMode.HardLink;
|
||||
}
|
||||
|
||||
if (!mode.HasFlag(TransferMode.Copy))
|
||||
{
|
||||
throw new IOException("Hardlinking from '" + sourcePath + "' to '" + targetPath + "' failed.");
|
||||
@@ -519,6 +538,7 @@ namespace NzbDrone.Common.Disk
|
||||
{
|
||||
throw new IOException(string.Format("Temporary file '{0}' still exists, aborting.", tempTargetPath));
|
||||
}
|
||||
|
||||
_logger.Trace("Hardlink move succeeded, deleting source.");
|
||||
_diskProvider.DeleteFile(sourcePath);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user