|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using FluentValidation;
|
|
|
|
|
using FluentValidation.Results;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
@ -22,6 +23,8 @@ namespace Readarr.Api.V1.Indexers
|
|
|
|
|
private readonly IIndexerFactory _indexerFactory;
|
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
private static readonly object PushLock = new object();
|
|
|
|
|
|
|
|
|
|
public ReleasePushController(IMakeDownloadDecision downloadDecisionMaker,
|
|
|
|
|
IProcessDownloadDecisions downloadDecisionProcessor,
|
|
|
|
|
IIndexerFactory indexerFactory,
|
|
|
|
@ -51,8 +54,13 @@ namespace Readarr.Api.V1.Indexers
|
|
|
|
|
|
|
|
|
|
ResolveIndexer(info);
|
|
|
|
|
|
|
|
|
|
var decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
|
|
|
|
List<DownloadDecision> decisions;
|
|
|
|
|
|
|
|
|
|
lock (PushLock)
|
|
|
|
|
{
|
|
|
|
|
decisions = _downloadDecisionMaker.GetRssDecision(new List<ReleaseInfo> { info });
|
|
|
|
|
_downloadDecisionProcessor.ProcessDecisions(decisions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var firstDecision = decisions.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|