diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs index 1a1367f45..6bf5ec207 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs @@ -192,5 +192,19 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications 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(); + } } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs index e390b37eb..43503d2b2 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs @@ -48,7 +48,13 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications _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);