Fixed: Checks full path for _UNPACK_ prefix so that full season downloads are properly checked for unpacking.

pull/2/head
Taloth Saldono 11 years ago
parent c04ae9f1d0
commit 50303ce470

@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
private void GivenInWorkingFolder() 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) private void GivenLastWriteTimeUtc(DateTime time)

@ -34,7 +34,10 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
foreach (var workingFolder in _configService.DownloadClientWorkingFolders.Split('|')) 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 (parent.Name.StartsWith(workingFolder))
{ {
if (OsInfo.IsMono) if (OsInfo.IsMono)
{ {
@ -48,6 +51,9 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
return false; return false;
} }
} }
parent = parent.Parent;
}
} }
return true; return true;

Loading…
Cancel
Save