mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 05:44:50 +00:00
Fixed: Movies without tags bypassing tags on Download Client
(cherry picked from commit c0e264cfc520ee387bfc882c95a5822c655e0d9b) Closes #10765
This commit is contained in:
parent
e4106f0ede
commit
4e024c51d3
1 changed files with 12 additions and 11 deletions
|
@ -38,6 +38,10 @@ public DownloadClientProvider(IDownloadClientStatusService downloadClientStatusS
|
||||||
|
|
||||||
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int indexerId = 0, bool filterBlockedClients = false, HashSet<int> tags = null)
|
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int indexerId = 0, bool filterBlockedClients = false, HashSet<int> tags = null)
|
||||||
{
|
{
|
||||||
|
// Tags aren't required, but download clients with tags should not be picked unless there is at least one matching tag.
|
||||||
|
// Defaulting to an empty HashSet ensures this is always checked.
|
||||||
|
tags ??= new HashSet<int>();
|
||||||
|
|
||||||
var blockedProviders = new HashSet<int>(_downloadClientStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
var blockedProviders = new HashSet<int>(_downloadClientStatusService.GetBlockedProviders().Select(v => v.ProviderId));
|
||||||
var availableProviders = _downloadClientFactory.GetAvailableProviders().Where(v => v.Protocol == downloadProtocol).ToList();
|
var availableProviders = _downloadClientFactory.GetAvailableProviders().Where(v => v.Protocol == downloadProtocol).ToList();
|
||||||
|
|
||||||
|
@ -46,8 +50,6 @@ public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tags is { Count: > 0 })
|
|
||||||
{
|
|
||||||
var matchingTagsClients = availableProviders.Where(i => i.Definition.Tags.Intersect(tags).Any()).ToList();
|
var matchingTagsClients = availableProviders.Where(i => i.Definition.Tags.Intersect(tags).Any()).ToList();
|
||||||
|
|
||||||
availableProviders = matchingTagsClients.Count > 0 ?
|
availableProviders = matchingTagsClients.Count > 0 ?
|
||||||
|
@ -58,7 +60,6 @@ public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int
|
||||||
{
|
{
|
||||||
throw new DownloadClientUnavailableException("No download client was found without tags or a matching movie tag. Please check your settings.");
|
throw new DownloadClientUnavailableException("No download client was found without tags or a matching movie tag. Please check your settings.");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (indexerId > 0)
|
if (indexerId > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue