mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Fixed: Don't rollback file move if destination already exists
Towards #5610 (cherry picked from commit f05405fe1ce4c78a8c75e27920c863c5b83686bd)
This commit is contained in:
@@ -501,9 +501,13 @@ namespace NzbDrone.Common.Disk
|
||||
throw new IOException(string.Format("File move incomplete, data loss may have occurred. [{0}] was {1} bytes long instead of the expected {2}.", targetPath, targetSize, originalSize));
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
RollbackPartialMove(sourcePath, targetPath);
|
||||
if (ex is not FileAlreadyExistsException)
|
||||
{
|
||||
RollbackPartialMove(sourcePath, targetPath);
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user