mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-02 21:24:56 +00:00
Fixed: Skip last write time check on linux for _UNPACK_ folders
This commit is contained in:
parent
743754a041
commit
46bd5d1767
2 changed files with 18 additions and 0 deletions
|
@ -68,5 +68,16 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
|
|||
|
||||
Subject.IsSatisfiedBy(_localEpisode).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_unopacking_on_linux()
|
||||
{
|
||||
LinuxOnly();
|
||||
|
||||
GivenInWorkingFolder();
|
||||
GivenLastWriteTimeUtc(DateTime.UtcNow.AddDays(-5));
|
||||
|
||||
Subject.IsSatisfiedBy(_localEpisode).Should().BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.IO;
|
||||
using NLog;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
|
@ -34,6 +35,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
|
|||
{
|
||||
if (Directory.GetParent(localEpisode.Path).Name.StartsWith(workingFolder))
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
_logger.Trace("{0} is still being unpacked", localEpisode.Path);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_diskProvider.GetLastFileWrite(localEpisode.Path) > DateTime.UtcNow.AddMinutes(-5))
|
||||
{
|
||||
_logger.Trace("{0} appears to be unpacking still", localEpisode.Path);
|
||||
|
|
Loading…
Reference in a new issue