mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-01 07:55:22 +02:00
Moving file from same source/destination no longer just deletes the file.
This commit is contained in:
@@ -125,14 +125,20 @@ namespace NzbDrone.Common
|
||||
File.Delete(path);
|
||||
}
|
||||
|
||||
public virtual void MoveFile(string sourcePath, string destinationPath)
|
||||
public virtual void MoveFile(string source, string destination)
|
||||
{
|
||||
if (FileExists(destinationPath))
|
||||
if (PathEquals(source, destination))
|
||||
{
|
||||
DeleteFile(destinationPath);
|
||||
Logger.Warn("Source and destination can't be the same {0}", source);
|
||||
return;
|
||||
}
|
||||
|
||||
File.Move(sourcePath, destinationPath);
|
||||
if (FileExists(destination))
|
||||
{
|
||||
DeleteFile(destination);
|
||||
}
|
||||
|
||||
File.Move(source, destination);
|
||||
}
|
||||
|
||||
public virtual void DeleteFolder(string path, bool recursive)
|
||||
|
Reference in New Issue
Block a user