mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -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:
@@ -1,10 +1,14 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Indexers;
|
||||
|
||||
namespace NzbDrone.Core.Download
|
||||
{
|
||||
public interface IProvideDownloadClient
|
||||
{
|
||||
IDownloadClient GetDownloadClient();
|
||||
IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol);
|
||||
IEnumerable<IDownloadClient> GetDownloadClients();
|
||||
}
|
||||
|
||||
public class DownloadClientProvider : IProvideDownloadClient
|
||||
@@ -16,9 +20,14 @@ namespace NzbDrone.Core.Download
|
||||
_downloadClientFactory = downloadClientFactory;
|
||||
}
|
||||
|
||||
public IDownloadClient GetDownloadClient()
|
||||
public IDownloadClient GetDownloadClient(DownloadProtocol downloadProtocol)
|
||||
{
|
||||
return _downloadClientFactory.Enabled().FirstOrDefault();
|
||||
return _downloadClientFactory.GetAvailableProviders().FirstOrDefault(v => v.Protocol == downloadProtocol);
|
||||
}
|
||||
|
||||
public IEnumerable<IDownloadClient> GetDownloadClients()
|
||||
{
|
||||
return _downloadClientFactory.GetAvailableProviders();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user