mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
20dbdfb344
Currently working: - Searching for new Movies on IMDb (very hacky) - Adding movie as a series with one season and episode (very hacky) - Rarbg.to indexer. (somewhat hacky) TODO: - Tweak release specifications so that they do not cause exceptions. - Add Movie struct so that searching for ones is not so hacky. - rework movies UI.
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using NLog;
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
|
{
|
|
public class SeasonMatchSpecification : IDecisionEngineSpecification
|
|
{
|
|
private readonly Logger _logger;
|
|
|
|
public SeasonMatchSpecification(Logger logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public RejectionType Type => RejectionType.Permanent;
|
|
|
|
public Decision IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
|
{
|
|
if (searchCriteria == null)
|
|
{
|
|
return Decision.Accept();
|
|
}
|
|
|
|
var singleEpisodeSpec = searchCriteria as SeasonSearchCriteria;
|
|
if (singleEpisodeSpec == null) return Decision.Accept();
|
|
|
|
if (singleEpisodeSpec.SeasonNumber != remoteEpisode.ParsedEpisodeInfo.SeasonNumber)
|
|
{
|
|
_logger.Debug("Season number does not match searched season number, skipping.");
|
|
//return Decision.Reject("Wrong season");
|
|
//Unnecessary for Movies
|
|
}
|
|
|
|
return Decision.Accept();
|
|
}
|
|
}
|
|
} |