You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
using NLog;
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
|
{
|
|
public class SeriesSpecification : IDecisionEngineSpecification
|
|
{
|
|
private readonly Logger _logger;
|
|
|
|
public SeriesSpecification(Logger logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public string RejectionReason
|
|
{
|
|
get
|
|
{
|
|
return "Wrong series";
|
|
}
|
|
}
|
|
|
|
public RejectionType Type { get { return RejectionType.Permanent; } }
|
|
|
|
public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteria)
|
|
{
|
|
if (searchCriteria == null)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
_logger.Debug("Checking if series matches searched series");
|
|
|
|
if (remoteEpisode.Series.Id != searchCriteria.Series.Id)
|
|
{
|
|
_logger.Debug("Series {0} does not match {1}", remoteEpisode.Series, searchCriteria.Series);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |