Renamed misnamed Decision Engine files

This commit is contained in:
Mark McDowall 2012-04-14 18:09:51 -07:00
parent 4947252f93
commit 733ebe3cfa
2 changed files with 22 additions and 22 deletions

View File

@ -1,31 +1,19 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
{ {
public class QualityUpgradeSpecification public class QualityAllowedByProfileSpecification
{ {
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); 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"); logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
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; return false;
} }

View File

@ -1,19 +1,31 @@
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Core.Model; using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
namespace NzbDrone.Core.Providers.DecisionEngine namespace NzbDrone.Core.Providers.DecisionEngine
{ {
public class QualityAllowedByProfileSpecification public class QualityUpgradeSpecification
{ {
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); 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 (currentQuality >= newQuality)
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.QualityType))
{ {
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; return false;
} }