Fixed: Regression with importing nested obfuscated directories.

Closes #2640
Taloth Saldono 6 years ago
parent 48126f55ed
commit e9b11e55e9

@ -29,6 +29,13 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
};
}
[Test]
public void should_return_true_if_no_fileinfo_available()
{
_localEpisode.FileEpisodeInfo = null;
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_when_file_contains_the_full_season()
{

@ -50,6 +50,15 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_file_name_is_not_parseable()
{
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01E01\AFDAFD.mkv".AsOsAgnostic();
_localEpisode.FileEpisodeInfo = null;
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_should_be_accepted_for_full_season()
{

@ -16,6 +16,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
public Decision IsSatisfiedBy(LocalEpisode localEpisode, DownloadClientItem downloadClientItem)
{
if (localEpisode.FileEpisodeInfo == null)
{
return Decision.Accept();
}
if (localEpisode.FileEpisodeInfo.FullSeason)
{
_logger.Debug("Single episode file detected as containing all episodes in the season");

@ -34,11 +34,19 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
if (folderInfo == null)
{
_logger.Debug("No folder ParsedEpisodeInfo, skipping check");
return Decision.Accept();
}
if (fileInfo == null)
{
_logger.Debug("No file ParsedEpisodeInfo, skipping check");
return Decision.Accept();
}
if (!folderInfo.EpisodeNumbers.Any())
{
_logger.Debug("No episode numbers in folder ParsedEpisodeInfo, skipping check");
return Decision.Accept();
}

Loading…
Cancel
Save