mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Feature/remove autofac from indexer manager (#1549)
* Line endings... * Remove Autofac and all its shenanigans from IndexerManager I'm starting my warpath against Autofac. For the next couple PRs I want to focus on refactoring things rather than creating new things. This includes introducing LINQ extensions wherever possible as well as removing Autofac/Automapper dependencies in classes (or any other dependency, there's a great chance that most of the classes that use Jackett.Services wouldn't need so many of them). All this is order to boost performance and eventually reach testability. Can't stop, won't stop. * Remove unnecessary extension * Modify test project * As per @kaso17, iterating through iterator types rather than allocating them manually * Cleaning up a little * Adjusting interface in tests
This commit is contained in:
@@ -57,7 +57,7 @@ namespace Jackett.Services
|
||||
private IUpdateService updater;
|
||||
private List<string> _notices = new List<string>();
|
||||
|
||||
public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u)
|
||||
public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IUpdateService u, IProtectionService protectionService)
|
||||
{
|
||||
indexerService = i;
|
||||
processService = p;
|
||||
@@ -68,6 +68,8 @@ namespace Jackett.Services
|
||||
updater = u;
|
||||
|
||||
LoadConfig();
|
||||
// "TEMPORARY" HACK
|
||||
protectionService.InstanceKey = Encoding.UTF8.GetBytes(Config.InstanceId);
|
||||
}
|
||||
|
||||
public ServerConfig Config
|
||||
@@ -283,13 +285,7 @@ namespace Jackett.Services
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
|
||||
// Load indexers
|
||||
indexerService.InitIndexers();
|
||||
foreach (string dir in configService.GetCardigannDefinitionsFolders())
|
||||
{
|
||||
indexerService.InitCardigannIndexers(dir);
|
||||
}
|
||||
indexerService.InitAggregateIndexer();
|
||||
indexerService.SortIndexers();
|
||||
indexerService.InitIndexers(configService.GetCardigannDefinitionsFolders());
|
||||
client.Init();
|
||||
updater.CleanupTempDir();
|
||||
}
|
||||
|
Reference in New Issue
Block a user