mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
New: Drone now uses the Download Client API to determine if a download is ready for import. (User configuration is required to replace the drone factory with this feature)
This commit is contained in:
@@ -40,12 +40,7 @@ namespace NzbDrone.Core.ThingiProvider
|
||||
|
||||
public List<TProviderDefinition> Templates()
|
||||
{
|
||||
return _providers.Select(p => new TProviderDefinition()
|
||||
{
|
||||
ConfigContract = p.ConfigContract.Name,
|
||||
Implementation = p.GetType().Name,
|
||||
Settings = (IProviderConfig)Activator.CreateInstance(p.ConfigContract)
|
||||
}).ToList();
|
||||
return _providers.Select(GetTemplate).ToList();
|
||||
}
|
||||
|
||||
public List<TProvider> GetAvailableProviders()
|
||||
@@ -87,6 +82,18 @@ namespace NzbDrone.Core.ThingiProvider
|
||||
return _providers.Select(c => c.GetType()).SingleOrDefault(c => c.Name.Equals(definition.Implementation, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
protected virtual TProviderDefinition GetTemplate(TProvider provider)
|
||||
{
|
||||
var definition = new TProviderDefinition()
|
||||
{
|
||||
ConfigContract = provider.ConfigContract.Name,
|
||||
Implementation = provider.GetType().Name,
|
||||
Settings = (IProviderConfig)Activator.CreateInstance(provider.ConfigContract)
|
||||
};
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
public void Handle(ApplicationStartedEvent message)
|
||||
{
|
||||
_logger.Debug("Initializing Providers. Count {0}", _providers.Count);
|
||||
|
||||
Reference in New Issue
Block a user