2012-02-07 06:08:07 +01:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.DecisionEngine
|
|
|
|
|
{
|
2012-04-15 03:09:51 +02:00
|
|
|
|
public class QualityAllowedByProfileSpecification
|
2012-02-07 06:08:07 +01:00
|
|
|
|
{
|
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
2012-04-15 03:09:51 +02:00
|
|
|
|
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
|
2012-02-07 06:08:07 +01:00
|
|
|
|
{
|
2012-04-15 03:09:51 +02:00
|
|
|
|
logger.Trace("Checking if report meets quality requirements. {0}", subject.Quality);
|
2012-10-14 02:36:16 +02:00
|
|
|
|
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.Quality))
|
2012-02-07 06:08:07 +01:00
|
|
|
|
{
|
2012-04-15 03:09:51 +02:00
|
|
|
|
logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
|
2012-02-07 06:08:07 +01:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|