mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
Fixed: Renaming Episodes will never overwrite existing files.
This commit is contained in:
committed by
Mark McDowall
parent
125e69da6d
commit
e5e00fd346
@@ -220,7 +220,7 @@ namespace NzbDrone.Common.Disk
|
||||
}
|
||||
case TransferAction.Move:
|
||||
{
|
||||
MoveFile(sourceFile.FullName, destFile);
|
||||
MoveFile(sourceFile.FullName, destFile, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -251,7 +251,7 @@ namespace NzbDrone.Common.Disk
|
||||
File.Copy(source, destination, overwrite);
|
||||
}
|
||||
|
||||
public void MoveFile(string source, string destination)
|
||||
public void MoveFile(string source, string destination, bool overwrite = false)
|
||||
{
|
||||
Ensure.That(source, () => source).IsValidPath();
|
||||
Ensure.That(destination, () => destination).IsValidPath();
|
||||
@@ -262,7 +262,7 @@ namespace NzbDrone.Common.Disk
|
||||
return;
|
||||
}
|
||||
|
||||
if (FileExists(destination))
|
||||
if (FileExists(destination) && overwrite)
|
||||
{
|
||||
DeleteFile(destination);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user