mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Fixed indexer register by name
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
public string DisplayDescription { get; private set; }
|
public string DisplayDescription { get; private set; }
|
||||||
public string DisplayName { get; private set; }
|
public string DisplayName { get; private set; }
|
||||||
public string ID { get { return StringUtil.StripNonAlphaNumeric(GetType().Name.ToLowerInvariant()); } }
|
public string ID { get { return GetIndexerID(GetType()); } }
|
||||||
public bool IsConfigured { get; protected set; }
|
public bool IsConfigured { get; protected set; }
|
||||||
public Uri SiteLink { get; private set; }
|
public Uri SiteLink { get; private set; }
|
||||||
public bool RequiresRageIDLookupDisabled { get; private set; }
|
public bool RequiresRageIDLookupDisabled { get; private set; }
|
||||||
@@ -26,6 +26,10 @@ namespace Jackett.Indexers
|
|||||||
protected static List<CachedResult> cache = new List<CachedResult>();
|
protected static List<CachedResult> cache = new List<CachedResult>();
|
||||||
protected static readonly TimeSpan cacheTime = new TimeSpan(0, 9, 0);
|
protected static readonly TimeSpan cacheTime = new TimeSpan(0, 9, 0);
|
||||||
|
|
||||||
|
public static string GetIndexerID(Type type)
|
||||||
|
{
|
||||||
|
return StringUtil.StripNonAlphaNumeric(type.Name.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
public BaseIndexer(string name, string description, bool rageid, Uri link, IIndexerManagerService manager, Logger logger)
|
public BaseIndexer(string name, string description, bool rageid, Uri link, IIndexerManagerService manager, Logger logger)
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,7 @@ namespace Jackett
|
|||||||
.Where(p => typeof(IIndexer).IsAssignableFrom(p) && !p.IsInterface)
|
.Where(p => typeof(IIndexer).IsAssignableFrom(p) && !p.IsInterface)
|
||||||
.ToArray())
|
.ToArray())
|
||||||
{
|
{
|
||||||
builder.RegisterType(indexer).Named<IIndexer>(indexer.Name);
|
builder.RegisterType(indexer).Named<IIndexer>(BaseIndexer.GetIndexerID(indexer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ namespace Jackett.Services
|
|||||||
var indexer = GetIndexer(name);
|
var indexer = GetIndexer(name);
|
||||||
var configPath = GetIndexerConfigFilePath(indexer);
|
var configPath = GetIndexerConfigFilePath(indexer);
|
||||||
File.Delete(configPath);
|
File.Delete(configPath);
|
||||||
indexers[name] = container.ResolveNamed<IIndexer>(name);
|
indexers[name] = container.ResolveNamed<IIndexer>(indexer.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetIndexerConfigFilePath(IIndexer indexer)
|
private string GetIndexerConfigFilePath(IIndexer indexer)
|
||||||
|
Reference in New Issue
Block a user