mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-25 22:59:10 -04:00
New: Alternative Site Links
This commit is contained in:
@@ -8,7 +8,7 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
public abstract class Unit3dBase : TorrentIndexerBase<Unit3dSettings>
|
||||
{
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
public override string BaseUrl => "";
|
||||
public override string[] IndexerUrls => new string[] { "" };
|
||||
public override bool SupportsRss => true;
|
||||
public override bool SupportsSearch => true;
|
||||
public override int PageSize => 50;
|
||||
@@ -30,14 +30,13 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
Settings = Settings,
|
||||
HttpClient = _httpClient,
|
||||
Logger = _logger,
|
||||
Capabilities = Capabilities,
|
||||
BaseUrl = BaseUrl
|
||||
Capabilities = Capabilities
|
||||
};
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new Unit3dParser(Capabilities.Categories, BaseUrl);
|
||||
return new Unit3dParser(Settings, Capabilities.Categories);
|
||||
}
|
||||
|
||||
protected virtual IndexerCapabilities SetCapabilities()
|
||||
|
||||
@@ -13,15 +13,15 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
{
|
||||
public class Unit3dParser : IParseIndexerResponse
|
||||
{
|
||||
private readonly string _baseUrl;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
private readonly Unit3dSettings _settings;
|
||||
|
||||
protected virtual string TorrentUrl => _baseUrl + "torrents";
|
||||
protected virtual string TorrentUrl => _settings.BaseUrl + "torrents";
|
||||
|
||||
public Unit3dParser(IndexerCapabilitiesCategories categories, string baseUrl)
|
||||
public Unit3dParser(Unit3dSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
_settings = settings;
|
||||
_categories = categories;
|
||||
_baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
@@ -11,13 +11,12 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
public class Unit3dRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
public Unit3dSettings Settings { get; set; }
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
public IHttpClient HttpClient { get; set; }
|
||||
public IndexerCapabilities Capabilities { get; set; }
|
||||
public Logger Logger { get; set; }
|
||||
|
||||
protected virtual string SearchUrl => BaseUrl + "api/torrents/filter";
|
||||
protected virtual string SearchUrl => Settings.BaseUrl + "api/torrents/filter";
|
||||
protected virtual bool ImdbInTags => false;
|
||||
|
||||
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
@@ -13,7 +12,7 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
}
|
||||
}
|
||||
|
||||
public class Unit3dSettings : IProviderConfig
|
||||
public class Unit3dSettings : IIndexerSettings
|
||||
{
|
||||
private static readonly Unit3dSettingsValidator Validator = new Unit3dSettingsValidator();
|
||||
|
||||
@@ -21,7 +20,10 @@ namespace NzbDrone.Core.Indexers.Definitions.UNIT3D
|
||||
{
|
||||
}
|
||||
|
||||
[FieldDefinition(1, Label = "Api Key", HelpText = "Api key generated in My Security", Privacy = PrivacyLevel.ApiKey)]
|
||||
[FieldDefinition(1, Label = "Base Url", Type = FieldType.Select, SelectOptionsProviderAction = "getUrls", HelpText = "Select which baseurl Prowlarr will use for requests to the site")]
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
[FieldDefinition(2, Label = "Api Key", HelpText = "Api key generated in My Security", Privacy = PrivacyLevel.ApiKey)]
|
||||
public string ApiKey { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
|
||||
Reference in New Issue
Block a user