|
|
@ -17,7 +17,7 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public interface IMakeDownloadDecision
|
|
|
|
public interface IMakeDownloadDecision
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports);
|
|
|
|
List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports, bool pushedRelease = false);
|
|
|
|
List<DownloadDecision> GetSearchDecision(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteriaBase);
|
|
|
|
List<DownloadDecision> GetSearchDecision(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteriaBase);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -45,17 +45,17 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports)
|
|
|
|
public List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports, bool pushedRelease = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return GetDecisions(reports).ToList();
|
|
|
|
return GetDecisions(reports).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<DownloadDecision> GetSearchDecision(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteriaBase)
|
|
|
|
public List<DownloadDecision> GetSearchDecision(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteriaBase)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return GetDecisions(reports, searchCriteriaBase).ToList();
|
|
|
|
return GetDecisions(reports, false, searchCriteriaBase).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IEnumerable<DownloadDecision> GetDecisions(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteria = null)
|
|
|
|
private IEnumerable<DownloadDecision> GetDecisions(List<ReleaseInfo> reports, bool pushedRelease = false, SearchCriteriaBase searchCriteria = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (reports.Any())
|
|
|
|
if (reports.Any())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -156,6 +156,26 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
|
|
|
|
|
|
|
if (decision != null)
|
|
|
|
if (decision != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var source = pushedRelease ? ReleaseSourceType.ReleasePush : ReleaseSourceType.Rss;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (searchCriteria != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (searchCriteria.InteractiveSearch)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
source = ReleaseSourceType.InteractiveSearch;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (searchCriteria.UserInvokedSearch)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
source = ReleaseSourceType.UserInvokedSearch;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
source = ReleaseSourceType.Search;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
decision.RemoteEpisode.ReleaseSource = source;
|
|
|
|
|
|
|
|
|
|
|
|
if (decision.Rejections.Any())
|
|
|
|
if (decision.Rejections.Any())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug("Release rejected for the following reasons: {0}", string.Join(", ", decision.Rejections));
|
|
|
|
_logger.Debug("Release rejected for the following reasons: {0}", string.Join(", ", decision.Rejections));
|
|
|
|