From e8d01daf03b9720c2a081b07af16ea6556fd7469 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 15 May 2017 23:58:07 -0700 Subject: [PATCH] Fixed: Ignore file quality matching release quality for season packs --- .../GrabbedReleaseQualityFixture.cs | 15 +++++++++++++++ .../GrabbedReleaseQualitySpecification.cs | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualityFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualityFixture.cs index f737fd388..4a3ea1a7c 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualityFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualityFixture.cs @@ -63,6 +63,21 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue(); } + [Test] + public void should_be_accepted_if_grabbed_history_is_for_a_season_pack() + { + var history = Builder.CreateListOfSize(1) + .All() + .With(h => h.EventType = HistoryEventType.Grabbed) + .With(h => h.Quality = _localEpisode.Quality) + .With(h => h.SourceTitle = "Series.Title.S01.720p.HDTV.x264-RlsGroup") + .BuildList(); + + GivenHistory(history); + + Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue(); + } + [Test] public void should_be_accepted_if_grabbed_history_quality_matches() { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs index 2af5f0852..0b12d6d41 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs @@ -36,6 +36,14 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications return Decision.Accept(); } + var parsedReleaseName = Parser.Parser.ParseTitle(grabbedHistory.First().SourceTitle); + + if (parsedReleaseName != null && parsedReleaseName.FullSeason) + { + _logger.Debug("File is part of a season pack, skipping."); + return Decision.Accept(); + } + foreach (var item in grabbedHistory) { if (item.Quality != localEpisode.Quality)