Build download requests from indexer implementation

(cherry picked from commit a0b08f6c6f106d92cdb12fbb959dd2605c22fe6a)
This commit is contained in:
Bogdan
2023-04-30 07:09:11 +03:00
parent 1978a726bb
commit 7a7039b1f7
26 changed files with 132 additions and 91 deletions
@@ -35,7 +35,7 @@ namespace NzbDrone.Core.Download
protected abstract string AddFromNzbFile(RemoteBook remoteBook, string filename, byte[] fileContent);
public override string Download(RemoteBook remoteBook)
public override string Download(RemoteBook remoteBook, IIndexer indexer)
{
var url = remoteBook.Release.DownloadUrl;
var filename = FileNameBuilder.CleanFileName(remoteBook.Release.Title) + ".nzb";
@@ -44,7 +44,7 @@ namespace NzbDrone.Core.Download
try
{
var request = new HttpRequest(url);
var request = indexer.GetDownloadRequest(url);
request.RateLimitKey = remoteBook?.Release?.IndexerId.ToString();
// TODO: Look into moving download request handling to indexer