mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Skip import when when folder is in use
Fixed: Skip post-processing when folder is in use or series path does not exist on disk
This commit is contained in:
parent
5014745f88
commit
5cc2810f77
4 changed files with 84 additions and 8 deletions
|
@ -227,14 +227,6 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
|
||||
WithValidSeries();
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.GetDirectorySize(downloadName))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FreeDiskSpace(It.IsAny<DirectoryInfo>()))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FolderExists(fakeSeries.Path))
|
||||
.Returns(false);
|
||||
|
@ -246,5 +238,24 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
|
|||
//Assert
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_skip_if_file_is_in_use_by_another_process()
|
||||
{
|
||||
var downloadName = @"C:\Test\Drop\30.Rock.S01E01.Pilot.mkv";
|
||||
|
||||
WithValidSeries();
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.IsFileLocked(It.Is<FileInfo>(f => f.FullName == downloadName)))
|
||||
.Returns(true);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<PostDownloadProvider>().ProcessVideoFile(downloadName);
|
||||
|
||||
|
||||
//Assert
|
||||
Mocker.GetMock<DiskScanProvider>().Verify(c => c.ImportFile(fakeSeries, downloadName), Times.Never());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue