mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -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,12 +1,20 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NLog;
|
||||
|
||||
namespace NzbDrone.Core.Download
|
||||
{
|
||||
public abstract class DownloadClientBase<TSettings> : IDownloadClient where TSettings : IProviderConfig, new()
|
||||
public abstract class DownloadClientBase<TSettings> : IDownloadClient
|
||||
where TSettings : IProviderConfig, new()
|
||||
{
|
||||
private readonly IParsingService _parsingService;
|
||||
protected readonly Logger _logger;
|
||||
|
||||
public Type ConfigContract
|
||||
{
|
||||
get
|
||||
@@ -33,17 +41,39 @@ namespace NzbDrone.Core.Download
|
||||
}
|
||||
}
|
||||
|
||||
protected DownloadClientBase(IParsingService parsingService, Logger logger)
|
||||
{
|
||||
_parsingService = parsingService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return GetType().Name;
|
||||
}
|
||||
|
||||
public abstract string DownloadNzb(RemoteEpisode remoteEpisode);
|
||||
public abstract IEnumerable<QueueItem> GetQueue();
|
||||
public abstract IEnumerable<HistoryItem> GetHistory(int start = 0, int limit = 10);
|
||||
public abstract void RemoveFromQueue(string id);
|
||||
public abstract void RemoveFromHistory(string id);
|
||||
|
||||
|
||||
public abstract DownloadProtocol Protocol
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract string Download(RemoteEpisode remoteEpisode);
|
||||
public abstract IEnumerable<DownloadClientItem> GetItems();
|
||||
public abstract void RemoveItem(string id);
|
||||
public abstract void RetryDownload(string id);
|
||||
public abstract void Test();
|
||||
|
||||
protected RemoteEpisode GetRemoteEpisode(String title)
|
||||
{
|
||||
var parsedEpisodeInfo = Parser.Parser.ParseTitle(title);
|
||||
if (parsedEpisodeInfo == null) return null;
|
||||
|
||||
var remoteEpisode = _parsingService.Map(parsedEpisodeInfo, 0);
|
||||
if (remoteEpisode.Series == null) return null;
|
||||
|
||||
return remoteEpisode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user