Download clients now use thingy provider

This commit is contained in:
Mark McDowall
2014-02-13 21:31:49 -08:00
parent ba22600412
commit 606d78f5e1
123 changed files with 2076 additions and 1820 deletions
@@ -0,0 +1,29 @@
using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.Composition;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Download
{
public interface IDownloadClientFactory : IProviderFactory<IDownloadClient, DownloadClientDefinition>
{
List<IDownloadClient> Enabled();
}
public class DownloadClientFactory : ProviderFactory<IDownloadClient, DownloadClientDefinition>, IDownloadClientFactory
{
private readonly IDownloadClientRepository _providerRepository;
public DownloadClientFactory(IDownloadClientRepository providerRepository, IEnumerable<IDownloadClient> providers, IContainer container, Logger logger)
: base(providerRepository, providers, container, logger)
{
_providerRepository = providerRepository;
}
public List<IDownloadClient> Enabled()
{
return GetAvailableProviders().Where(n => ((DownloadClientDefinition)n.Definition).Enable).ToList();
}
}
}