mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-22 22:43:31 -07:00
Align DownloadService with upstream
This commit is contained in:
parent
b322d84846
commit
b4f8ca74a6
1 changed files with 12 additions and 5 deletions
|
@ -50,14 +50,22 @@ namespace NzbDrone.Core.Download
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DownloadReport(RemoteAlbum remoteAlbum)
|
public void DownloadReport(RemoteAlbum remoteAlbum)
|
||||||
|
{
|
||||||
|
var filterBlockedClients = remoteAlbum.Release.PendingReleaseReason == PendingReleaseReason.DownloadClientUnavailable;
|
||||||
|
|
||||||
|
var tags = remoteAlbum.Artist?.Tags;
|
||||||
|
|
||||||
|
var downloadClient = _downloadClientProvider.GetDownloadClient(remoteAlbum.Release.DownloadProtocol, remoteAlbum.Release.IndexerId, filterBlockedClients, tags);
|
||||||
|
|
||||||
|
DownloadReport(remoteAlbum, downloadClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DownloadReport(RemoteAlbum remoteAlbum, IDownloadClient downloadClient)
|
||||||
{
|
{
|
||||||
Ensure.That(remoteAlbum.Artist, () => remoteAlbum.Artist).IsNotNull();
|
Ensure.That(remoteAlbum.Artist, () => remoteAlbum.Artist).IsNotNull();
|
||||||
Ensure.That(remoteAlbum.Albums, () => remoteAlbum.Albums).HasItems();
|
Ensure.That(remoteAlbum.Albums, () => remoteAlbum.Albums).HasItems();
|
||||||
|
|
||||||
var downloadTitle = remoteAlbum.Release.Title;
|
var downloadTitle = remoteAlbum.Release.Title;
|
||||||
var filterBlockedClients = remoteAlbum.Release.PendingReleaseReason == PendingReleaseReason.DownloadClientUnavailable;
|
|
||||||
var tags = remoteAlbum.Artist?.Tags;
|
|
||||||
var downloadClient = _downloadClientProvider.GetDownloadClient(remoteAlbum.Release.DownloadProtocol, remoteAlbum.Release.IndexerId, filterBlockedClients, tags);
|
|
||||||
|
|
||||||
if (downloadClient == null)
|
if (downloadClient == null)
|
||||||
{
|
{
|
||||||
|
@ -100,8 +108,7 @@ namespace NzbDrone.Core.Download
|
||||||
}
|
}
|
||||||
catch (ReleaseDownloadException ex)
|
catch (ReleaseDownloadException ex)
|
||||||
{
|
{
|
||||||
var http429 = ex.InnerException as TooManyRequestsException;
|
if (ex.InnerException is TooManyRequestsException http429)
|
||||||
if (http429 != null)
|
|
||||||
{
|
{
|
||||||
_indexerStatusService.RecordFailure(remoteAlbum.Release.IndexerId, http429.RetryAfter);
|
_indexerStatusService.RecordFailure(remoteAlbum.Release.IndexerId, http429.RetryAfter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue