|
|
|
@ -16,12 +16,14 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
{
|
|
|
|
|
private readonly IIndexerRepository _providerRepository;
|
|
|
|
|
private readonly IEnumerable<IIndexer> _providers;
|
|
|
|
|
private readonly INewznabTestService _newznabTestService;
|
|
|
|
|
|
|
|
|
|
public IndexerFactory(IIndexerRepository providerRepository, IEnumerable<IIndexer> providers, IContainer container, Logger logger)
|
|
|
|
|
public IndexerFactory(IIndexerRepository providerRepository, IEnumerable<IIndexer> providers, IContainer container, INewznabTestService newznabTestService, Logger logger)
|
|
|
|
|
: base(providerRepository, providers, container, logger)
|
|
|
|
|
{
|
|
|
|
|
_providerRepository = providerRepository;
|
|
|
|
|
_providers = providers;
|
|
|
|
|
_newznabTestService = newznabTestService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void InitializeProviders()
|
|
|
|
@ -43,5 +45,16 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
|
{
|
|
|
|
|
return base.Active().Where(c => c.Enable).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IndexerDefinition Create(IndexerDefinition definition)
|
|
|
|
|
{
|
|
|
|
|
if (definition.Implementation == typeof(Newznab.Newznab).Name)
|
|
|
|
|
{
|
|
|
|
|
var indexer = GetInstance(definition);
|
|
|
|
|
_newznabTestService.Test(indexer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.Create(definition);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|