1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-30 19:56:54 +00:00
Sonarr/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs

35 lines
975 B
C#

using NLog;
using NzbDrone.Core.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class QualityAllowedByProfileSpecification : IFetchableSpecification
{
private readonly Logger _logger;
public QualityAllowedByProfileSpecification(Logger logger)
{
_logger = logger;
}
public string RejectionReason
{
get
{
return "Quality rejected by series profile";
}
}
public virtual bool IsSatisfiedBy(EpisodeParseResult 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;
}
}
}