1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-29 11:05:44 +00:00
Lidarr/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs

35 lines
901 B
C#

using NLog;
using NzbDrone.Core.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class LanguageSpecification : IFetchableSpecification
{
private readonly Logger _logger;
public LanguageSpecification(Logger logger)
{
_logger = logger;
}
public string RejectionReason
{
get
{
return "Not English";
}
}
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
_logger.Trace("Checking if report meets language requirements. {0}", subject.Language);
if (subject.Language != LanguageType.English)
{
_logger.Trace("Report Language: {0} rejected because it is not English", subject.Language);
return false;
}
return true;
}
}
}