1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-22 07:43:01 +00:00

Fixed: Series without tags bypassing tags on Download Client

Closes #7474
This commit is contained in:
Mark McDowall 2024-12-10 19:22:58 -08:00
parent 811eb36c7b
commit c0e264cfc5

View file

@ -38,6 +38,10 @@ namespace NzbDrone.Core.Download
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol, int indexerId = 0, bool filterBlockedClients = false, HashSet<int> tags = null)
{
// Tags aren't required, but indexers 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 availableProviders = _downloadClientFactory.GetAvailableProviders().Where(v => v.Protocol == downloadProtocol).ToList();
@ -46,8 +50,6 @@ namespace NzbDrone.Core.Download
return null;
}
if (tags is { Count: > 0 })
{
var matchingTagsClients = availableProviders.Where(i => i.Definition.Tags.Intersect(tags).Any()).ToList();
availableProviders = matchingTagsClients.Count > 0 ?
@ -58,7 +60,6 @@ namespace NzbDrone.Core.Download
{
throw new DownloadClientUnavailableException("No download client was found without tags or a matching series tag. Please check your settings.");
}
}
if (indexerId > 0)
{