mirror of https://github.com/Jackett/Jackett
Make Cardigann indexers deletable
This commit is contained in:
parent
db4717b714
commit
2ffdc1678b
|
@ -24,6 +24,7 @@ namespace Jackett.Indexers
|
|||
{
|
||||
public class CardigannIndexer : BaseIndexer, IIndexer
|
||||
{
|
||||
public string DefinitionString { get; protected set; }
|
||||
protected IndexerDefinition Definition;
|
||||
public new string ID { get { return (Definition != null ? Definition.Site : GetIndexerID(GetType())); } }
|
||||
|
||||
|
@ -144,6 +145,7 @@ namespace Jackett.Indexers
|
|||
|
||||
protected void Init(string DefinitionString)
|
||||
{
|
||||
this.DefinitionString = DefinitionString;
|
||||
var deserializer = new DeserializerBuilder()
|
||||
.WithNamingConvention(new CamelCaseNamingConvention())
|
||||
.IgnoreUnmatchedProperties()
|
||||
|
|
|
@ -140,7 +140,14 @@ namespace Jackett.Services
|
|||
var indexer = GetIndexer(name);
|
||||
var configPath = GetIndexerConfigFilePath(indexer);
|
||||
File.Delete(configPath);
|
||||
indexers[name] = container.ResolveNamed<IIndexer>(indexer.ID);
|
||||
if (indexer.GetType() == typeof(CardigannIndexer))
|
||||
{
|
||||
indexers[name] = new CardigannIndexer(this, container.Resolve<IWebClient>(), logger, container.Resolve<IProtectionService>(), ((CardigannIndexer)indexer).DefinitionString);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexers[name] = container.ResolveNamed<IIndexer>(indexer.ID);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetIndexerConfigFilePath(IIndexer indexer)
|
||||
|
|
Loading…
Reference in New Issue