1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 16:04:08 +01:00
Radarr/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs

38 lines
1.0 KiB
C#
Raw Normal View History

using NLog;
using NzbDrone.Core.Model;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
2013-04-07 09:30:37 +02:00
public class QualityAllowedByProfileSpecification : IDecisionEngineSpecification
{
private readonly Logger _logger;
public QualityAllowedByProfileSpecification(Logger logger)
{
_logger = logger;
}
public string RejectionReason
{
get
{
return "Quality rejected by series profile";
}
}
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
{
_logger.Trace("Checking if report meets quality requirements. {0}", subject.Quality);
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.Quality))
{
_logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
return false;
}
return true;
}
}
}