diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs index 1ed999597..29b87cc42 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecificationFixture.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using FizzWare.NBuilder; using FluentAssertions; @@ -258,5 +259,28 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue(); } + + [Test] + public void should_be_accepted_if_scene_season_number_matches_but_season_number_does_not() + { + _localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01\S01E01.mkv".AsOsAgnostic(); + _localEpisode.FolderEpisodeInfo.EpisodeNumbers = Array.Empty(); + _localEpisode.FolderEpisodeInfo.FullSeason = true; + + var episode = Builder.CreateNew() + .With(e => e.Id = (1 * 10) + 5) + .With(e => e.SeasonNumber = 5) + .With(e => e.SceneSeasonNumber = 1) + .With(e => e.EpisodeNumber = 5) + .Build(); + + Mocker.GetMock() + .Setup(s => s.GetEpisodes(_localEpisode.FileEpisodeInfo, It.IsAny(), true, null)) + .Returns(new List { episode }); + + GivenEpisodes(_localEpisode.FolderEpisodeInfo, new[] { 1, 2, 3, 4, 5 }); + + 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 9f10c1030..f4b346d5c 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs @@ -62,11 +62,6 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications return Decision.Accept(); } - if (folderEpisodes.First().SeasonNumber != fileEpisodes.FirstOrDefault()?.SeasonNumber) - { - return Decision.Reject("Season number {0} was unexpected considering the folder name {1}", fileInfo.SeasonNumber, folderInfo.ReleaseTitle); - } - var unexpected = fileEpisodes.Where(e => folderEpisodes.All(o => o.Id != e.Id)).ToList(); if (unexpected.Any())