You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
4 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using FluentValidation.Results;
|
||
|
using NzbDrone.Common.Http;
|
||
|
using NzbDrone.Core.ThingiProvider;
|
||
|
|
||
|
namespace NzbDrone.Core.IndexerProxies
|
||
|
{
|
||
|
public abstract class IndexerProxyBase<TSettings> : IIndexerProxy
|
||
|
where TSettings : IIndexerProxySettings, new()
|
||
|
{
|
||
|
public abstract string Name { get; }
|
||
|
public virtual ProviderMessage Message => null;
|
||
|
|
||
|
public Type ConfigContract => typeof(TSettings);
|
||
|
|
||
|
public IEnumerable<ProviderDefinition> DefaultDefinitions => new List<ProviderDefinition>();
|
||
|
|
||
|
public ProviderDefinition Definition { get; set; }
|
||
|
public abstract ValidationResult Test();
|
||
|
|
||
|
public abstract HttpRequest PreRequest(HttpRequest request);
|
||
|
public virtual HttpResponse PostResponse(HttpResponse response)
|
||
|
{
|
||
|
return response;
|
||
|
}
|
||
|
|
||
|
protected TSettings Settings => (TSettings)Definition.Settings;
|
||
|
|
||
|
public override string ToString()
|
||
|
{
|
||
|
return GetType().Name;
|
||
|
}
|
||
|
|
||
|
public virtual object RequestAction(string action, IDictionary<string, string> query)
|
||
|
{
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|