* Stylecop Rules and Fixes
This commit is contained in:
Qstick
2020-01-03 07:49:24 -05:00
committed by GitHub
parent 63d669178d
commit f77a2feeef
1307 changed files with 8704 additions and 7404 deletions
@@ -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;