mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 18:42:42 +01:00
Fixed: Checks full path for _UNPACK_ prefix so that full season downloads are properly checked for unpacking.
This commit is contained in:
parent
c04ae9f1d0
commit
50303ce470
@ -36,7 +36,7 @@ public void Setup()
|
||||
|
||||
private void GivenInWorkingFolder()
|
||||
{
|
||||
_localEpisode.Path = @"C:\Test\Unsorted TV\_UNPACK_30.rock\30.rock.s01e01.avi".AsOsAgnostic();
|
||||
_localEpisode.Path = @"C:\Test\Unsorted TV\_UNPACK_30.rock\someSubFolder\30.rock.s01e01.avi".AsOsAgnostic();
|
||||
}
|
||||
|
||||
private void GivenLastWriteTimeUtc(DateTime time)
|
||||
|
@ -34,19 +34,25 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode)
|
||||
|
||||
foreach (var workingFolder in _configService.DownloadClientWorkingFolders.Split('|'))
|
||||
{
|
||||
if (Directory.GetParent(localEpisode.Path).Name.StartsWith(workingFolder))
|
||||
DirectoryInfo parent = Directory.GetParent(localEpisode.Path);
|
||||
while (parent != null)
|
||||
{
|
||||
if (OsInfo.IsMono)
|
||||
if (parent.Name.StartsWith(workingFolder))
|
||||
{
|
||||
_logger.Debug("{0} is still being unpacked", localEpisode.Path);
|
||||
return false;
|
||||
if (OsInfo.IsMono)
|
||||
{
|
||||
_logger.Debug("{0} is still being unpacked", localEpisode.Path);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_diskProvider.FileGetLastWriteUtc(localEpisode.Path) > DateTime.UtcNow.AddMinutes(-5))
|
||||
{
|
||||
_logger.Debug("{0} appears to be unpacking still", localEpisode.Path);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (_diskProvider.FileGetLastWriteUtc(localEpisode.Path) > DateTime.UtcNow.AddMinutes(-5))
|
||||
{
|
||||
_logger.Debug("{0} appears to be unpacking still", localEpisode.Path);
|
||||
return false;
|
||||
}
|
||||
parent = parent.Parent;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user