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:
Taloth Saldono
2014-04-19 17:09:22 +02:00
parent dcb586b937
commit 2035fe8578
196 changed files with 3961 additions and 2223 deletions
@@ -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);