Skip to content

Commit

Permalink
Fixed: Don't reject standard/absolute numbering mismatch due to seaso…
Browse files Browse the repository at this point in the history
…n number
  • Loading branch information
markus101 committed Jul 27, 2019
1 parent c47e7cd commit 894de92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Expand Up @@ -192,5 +192,19 @@ public void should_be_accepted_if_both_file_and_folder_info_map_to_same_special(

Subject.IsSatisfiedBy(localEpisode, null).Accepted.Should().BeTrue();
}

[Test]
public void should_be_accepted_if_file_has_absolute_episode_number_and_folder_uses_standard()
{
_localEpisode.FileEpisodeInfo.SeasonNumber = 0;
_localEpisode.FileEpisodeInfo.AbsoluteEpisodeNumbers = new[] { 1 };

_localEpisode.FolderEpisodeInfo.SeasonNumber = 1;
_localEpisode.FolderEpisodeInfo.EpisodeNumbers = new[] { 1, 2 };

_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01.720p.HDTV-Sonarr\S02E01.mkv".AsOsAgnostic();

Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
}
}
Expand Up @@ -48,7 +48,13 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode, DownloadClientItem down
_logger.Debug("No file ParsedEpisodeInfo, skipping check");
return Decision.Accept();
}


if (fileInfo.IsAbsoluteNumbering)
{
_logger.Debug("File uses absolute episode numbering, skipping check");
return Decision.Accept();
}

if (folderInfo.SeasonNumber != fileInfo.SeasonNumber)
{
return Decision.Reject("Season number {0} was unexpected considering the folder name {1}", fileInfo.SeasonNumber, folderInfo.ReleaseTitle);
Expand Down

0 comments on commit 894de92

Please sign in to comment.