mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
Renamed misnamed Decision Engine files
This commit is contained in:
parent
4947252f93
commit
733ebe3cfa
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user