Skip to content

Commit

Permalink
Add defaults definitions for indexer proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan committed May 27, 2023
1 parent 29ab180 commit d9ce9eb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/NzbDrone.Core/IndexerProxies/IndexerProxyBase.cs
Expand Up @@ -14,7 +14,20 @@ public abstract class IndexerProxyBase<TSettings> : IIndexerProxy

public Type ConfigContract => typeof(TSettings);

public IEnumerable<ProviderDefinition> DefaultDefinitions => new List<ProviderDefinition>();
public IEnumerable<ProviderDefinition> DefaultDefinitions
{
get
{
var config = (IProviderConfig)new TSettings();

yield return new IndexerProxyDefinition
{
Name = GetType().Name,
Implementation = GetType().Name,
Settings = config
};
}
}

public ProviderDefinition Definition { get; set; }
public abstract ValidationResult Test();
Expand Down

0 comments on commit d9ce9eb

Please sign in to comment.