|
|
@ -52,23 +52,14 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
|
|
|
|
|
|
|
private IIndexerProxy GetProxy(ProviderDefinition definition)
|
|
|
|
private IIndexerProxy GetProxy(ProviderDefinition definition)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Skip DB call if no tags on the indexers
|
|
|
|
// Skip DB call if no tags on the indexers
|
|
|
|
if (definition.Tags.Count == 0 && definition.Id > 0)
|
|
|
|
if (definition.Tags.Count == 0 && definition.Id > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var proxies = _indexerProxyFactory.GetAvailableProviders();
|
|
|
|
var proxies = _indexerProxyFactory.GetAvailableProviders();
|
|
|
|
IIndexerProxy selectedProxy = null;
|
|
|
|
var selectedProxy = proxies.FirstOrDefault(proxy => definition.Tags.Intersect(proxy.Definition.Tags).Any());
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var proxy in proxies)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (definition.Tags.Intersect(proxy.Definition.Tags).Any())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
selectedProxy = proxy;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedProxy == null && definition.Id == 0)
|
|
|
|
if (selectedProxy == null && definition.Id == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|