From 883f7b88cf7075c9e476e97749293f9b01b6b75f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 23 Jan 2018 18:50:26 -0800 Subject: [PATCH] Removed DailyEpisodeMatchSpecification in favour of SingleEpisodeSearchMatchSpecification Fixed: Parsing releases with standard and daily formats --- .../Search/DailyEpisodeMatchSpecification.cs | 44 ------------------- src/NzbDrone.Core/NzbDrone.Core.csproj | 1 - 2 files changed, 45 deletions(-) delete mode 100644 src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs deleted file mode 100644 index 49136428f..000000000 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs +++ /dev/null @@ -1,44 +0,0 @@ -using NLog; -using NzbDrone.Core.IndexerSearch.Definitions; -using NzbDrone.Core.Parser.Model; -using NzbDrone.Core.Tv; - -namespace NzbDrone.Core.DecisionEngine.Specifications.Search -{ - public class DailyEpisodeMatchSpecification : IDecisionEngineSpecification - { - private readonly Logger _logger; - private readonly IEpisodeService _episodeService; - - public DailyEpisodeMatchSpecification(Logger logger, IEpisodeService episodeService) - { - _logger = logger; - _episodeService = episodeService; - } - - public SpecificationPriority Priority => SpecificationPriority.Database; - public RejectionType Type => RejectionType.Permanent; - - public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria) - { - if (searchCriteria == null) - { - return Decision.Accept(); - } - - var dailySearchSpec = searchCriteria as DailyEpisodeSearchCriteria; - - if (dailySearchSpec == null) return Decision.Accept(); - - var episode = _episodeService.GetEpisode(dailySearchSpec.Series.Id, dailySearchSpec.AirDate.ToString(Episode.AIR_DATE_FORMAT)); - - if (!remoteEpisode.ParsedEpisodeInfo.IsDaily || remoteEpisode.ParsedEpisodeInfo.AirDate != episode.AirDate) - { - _logger.Debug("Episode AirDate does not match searched episode number, skipping."); - return Decision.Reject("Episode does not match"); - } - - return Decision.Accept(); - } - } -} diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index c6851055d..6fa51c9d9 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -346,7 +346,6 @@ -