Allow to override download client

Towards #2331
This commit is contained in:
Bogdan
2024-01-13 00:27:53 +02:00
parent e968fcaff6
commit d23ce9ecc2
7 changed files with 35 additions and 30 deletions
@@ -124,7 +124,7 @@ namespace Readarr.Api.V1.Indexers
throw new NzbDroneClientException(HttpStatusCode.NotFound, "Unable to parse books in the release");
}
await _downloadService.DownloadReport(remoteBook);
await _downloadService.DownloadReport(remoteBook, release.DownloadClientId);
}
catch (ReleaseDownloadException ex)
{
@@ -56,6 +56,9 @@ namespace Readarr.Api.V1.Indexers
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int? BookId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int? DownloadClientId { get; set; }
}
public static class ReleaseResourceMapper
@@ -30,7 +30,7 @@ namespace Readarr.Api.V1.Queue
throw new NotFoundException();
}
await _downloadService.DownloadReport(pendingRelease.RemoteBook);
await _downloadService.DownloadReport(pendingRelease.RemoteBook, null);
return new { };
}
@@ -48,7 +48,7 @@ namespace Readarr.Api.V1.Queue
throw new NotFoundException();
}
await _downloadService.DownloadReport(pendingRelease.RemoteBook);
await _downloadService.DownloadReport(pendingRelease.RemoteBook, null);
}
return new { };