2014-02-14 05:31:49 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Download
|
|
|
|
|
{
|
|
|
|
|
public abstract class DownloadClientBase<TSettings> : IDownloadClient where TSettings : IProviderConfig, new()
|
|
|
|
|
{
|
|
|
|
|
public Type ConfigContract
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return typeof(TSettings);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<ProviderDefinition> DefaultDefinitions
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return new List<ProviderDefinition>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProviderDefinition Definition { get; set; }
|
|
|
|
|
|
|
|
|
|
protected TSettings Settings
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (TSettings)Definition.Settings;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return GetType().Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract string DownloadNzb(RemoteEpisode remoteEpisode);
|
|
|
|
|
public abstract IEnumerable<QueueItem> GetQueue();
|
2014-02-18 01:57:20 +00:00
|
|
|
|
public abstract IEnumerable<HistoryItem> GetHistory(int start = 0, int limit = 10);
|
2014-02-14 05:31:49 +00:00
|
|
|
|
public abstract void RemoveFromQueue(string id);
|
|
|
|
|
public abstract void RemoveFromHistory(string id);
|
2014-04-01 20:07:41 +00:00
|
|
|
|
public abstract void RetryDownload(string id);
|
2014-02-26 05:40:47 +00:00
|
|
|
|
public abstract void Test();
|
2014-02-14 05:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|