mirror of
https://github.com/Lidarr/Lidarr
synced 2026-03-03 19:12:49 +01:00
Tweaked error message when TransferFile destination already exists.
This commit is contained in:
parent
e16e4091f1
commit
f91e1a3576
1 changed files with 4 additions and 4 deletions
|
|
@ -223,7 +223,7 @@ public TransferMode TransferFile(string sourcePath, string targetPath, TransferM
|
|||
_diskProvider.MoveFile(sourcePath, tempPath, true);
|
||||
try
|
||||
{
|
||||
ClearTargetPath(targetPath, overwrite);
|
||||
ClearTargetPath(sourcePath, targetPath, overwrite);
|
||||
|
||||
_diskProvider.MoveFile(tempPath, targetPath);
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ public TransferMode TransferFile(string sourcePath, string targetPath, TransferM
|
|||
throw new IOException(string.Format("Destination cannot be a child of the source [{0}] => [{1}]", sourcePath, targetPath));
|
||||
}
|
||||
|
||||
ClearTargetPath(targetPath, overwrite);
|
||||
ClearTargetPath(sourcePath, targetPath, overwrite);
|
||||
|
||||
if (mode.HasFlag(TransferMode.HardLink))
|
||||
{
|
||||
|
|
@ -330,7 +330,7 @@ public TransferMode TransferFile(string sourcePath, string targetPath, TransferM
|
|||
return TransferMode.None;
|
||||
}
|
||||
|
||||
private void ClearTargetPath(string targetPath, bool overwrite)
|
||||
private void ClearTargetPath(string sourcePath, string targetPath, bool overwrite)
|
||||
{
|
||||
if (_diskProvider.FileExists(targetPath))
|
||||
{
|
||||
|
|
@ -340,7 +340,7 @@ private void ClearTargetPath(string targetPath, bool overwrite)
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new IOException(string.Format("Destination already exists [{0}]", targetPath));
|
||||
throw new IOException(string.Format("Destination already exists. [{0}] to [{1}]", sourcePath, targetPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue