Renamed misnamed Decision Engine files

pull/4/head
Mark McDowall 13 years ago
parent 4947252f93
commit 733ebe3cfa

@ -1,31 +1,19 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Providers.DecisionEngine
{
public class QualityUpgradeSpecification
public class QualityAllowedByProfileSpecification
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual bool IsSatisfiedBy(Quality currentQuality, Quality newQuality, QualityTypes cutOff)
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
if (currentQuality >= newQuality)
logger.Trace("Checking if report meets quality requirements. {0}", subject.Quality);
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.QualityType))
{
logger.Trace("existing item has better or equal quality. skipping");
return false;
}
if (currentQuality.QualityType == newQuality.QualityType && newQuality.Proper)
{
logger.Trace("Upgrading existing item to proper.");
return true;
}
if (currentQuality.QualityType >= cutOff)
{
logger.Trace("Existing item meets cut-off. skipping.");
logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
return false;
}

@ -1,19 +1,31 @@
using System.Linq;
using NLog;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Providers.DecisionEngine
{
public class QualityAllowedByProfileSpecification
public class QualityUpgradeSpecification
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
public virtual bool IsSatisfiedBy(Quality currentQuality, Quality newQuality, QualityTypes cutOff)
{
logger.Trace("Checking if report meets quality requirements. {0}", subject.Quality);
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.QualityType))
if (currentQuality >= newQuality)
{
logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
logger.Trace("existing item has better or equal quality. skipping");
return false;
}
if (currentQuality.QualityType == newQuality.QualityType && newQuality.Proper)
{
logger.Trace("Upgrading existing item to proper.");
return true;
}
if (currentQuality.QualityType >= cutOff)
{
logger.Trace("Existing item meets cut-off. skipping.");
return false;
}

Loading…
Cancel
Save