mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 21:21:47 +02:00
Fixed: Regression in folder move logic preventing updater from working.
This commit is contained in:
parent
f215ba9bac
commit
cf327077e9
2 changed files with 19 additions and 1 deletions
|
|
@ -813,6 +813,24 @@ public void TransferFolder_should_use_movefolder_if_on_same_mount()
|
|||
.Verify(v => v.MoveFolder(src, dst), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TransferFolder_should_not_use_movefolder_if_on_same_mount_but_target_already_exists()
|
||||
{
|
||||
WithEmulatedDiskProvider();
|
||||
|
||||
var src = @"C:\Base1\TestDir1".AsOsAgnostic();
|
||||
var dst = @"C:\Base1\TestDir2".AsOsAgnostic();
|
||||
|
||||
WithMockMount(@"C:\Base1".AsOsAgnostic());
|
||||
WithExistingFile(@"C:\Base1\TestDir1\test.file.txt".AsOsAgnostic());
|
||||
WithExistingFolder(dst);
|
||||
|
||||
Subject.TransferFolder(src, dst, TransferMode.Move);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Verify(v => v.MoveFolder(src, dst), Times.Never());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TransferFolder_should_not_use_movefolder_if_on_same_mount_but_transactional()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public TransferMode TransferFolder(string sourcePath, string targetPath, Transfe
|
|||
Ensure.That(sourcePath, () => sourcePath).IsValidPath();
|
||||
Ensure.That(targetPath, () => targetPath).IsValidPath();
|
||||
|
||||
if (mode == TransferMode.Move)
|
||||
if (mode == TransferMode.Move && !_diskProvider.FolderExists(targetPath))
|
||||
{
|
||||
if (verificationMode == DiskTransferVerificationMode.TryTransactional || verificationMode == DiskTransferVerificationMode.VerifyOnly)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue