|
|
|
@ -16,7 +16,7 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -41,17 +41,17 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports)
|
|
|
|
|
public List<DownloadDecision> GetRssDecision(List<ReleaseInfo> reports, bool pushedRelease = false)
|
|
|
|
|
{
|
|
|
|
|
return GetAlbumDecisions(reports).ToList();
|
|
|
|
|
return GetAlbumDecisions(reports, pushedRelease).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<DownloadDecision> GetSearchDecision(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteriaBase)
|
|
|
|
|
{
|
|
|
|
|
return GetAlbumDecisions(reports, searchCriteriaBase).ToList();
|
|
|
|
|
return GetAlbumDecisions(reports, false, searchCriteriaBase).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerable<DownloadDecision> GetAlbumDecisions(List<ReleaseInfo> reports, SearchCriteriaBase searchCriteria = null)
|
|
|
|
|
private IEnumerable<DownloadDecision> GetAlbumDecisions(List<ReleaseInfo> reports, bool pushedRelease, SearchCriteriaBase searchCriteria = null)
|
|
|
|
|
{
|
|
|
|
|
if (reports.Any())
|
|
|
|
|
{
|
|
|
|
@ -169,6 +169,26 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
|
|
|
|
|
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.RemoteAlbum.ReleaseSource = source;
|
|
|
|
|
|
|
|
|
|
if (decision.Rejections.Any())
|
|
|
|
|
{
|
|
|
|
|
_logger.Debug("Release rejected for the following reasons: {0}", string.Join(", ", decision.Rejections));
|
|
|
|
|