mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-25 22:59:10 -04:00
Indexer Cleanup
This commit is contained in:
@@ -13,6 +13,7 @@ using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
using NzbDrone.Core.Indexers.Settings;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.Parser;
|
||||
@@ -21,7 +22,7 @@ using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions
|
||||
{
|
||||
public class RevolutionTT : TorrentIndexerBase<RevolutionTTSettings>
|
||||
public class RevolutionTT : TorrentIndexerBase<UserPassTorrentBaseSettings>
|
||||
{
|
||||
public override string Name => "RevolutionTT";
|
||||
|
||||
@@ -154,7 +155,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
||||
public class RevolutionTTRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
public RevolutionTTSettings Settings { get; set; }
|
||||
public UserPassTorrentBaseSettings Settings { get; set; }
|
||||
public IndexerCapabilities Capabilities { get; set; }
|
||||
|
||||
public RevolutionTTRequestGenerator()
|
||||
@@ -247,10 +248,10 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
||||
public class RevolutionTTParser : IParseIndexerResponse
|
||||
{
|
||||
private readonly RevolutionTTSettings _settings;
|
||||
private readonly UserPassTorrentBaseSettings _settings;
|
||||
private readonly IndexerCapabilitiesCategories _categories;
|
||||
|
||||
public RevolutionTTParser(RevolutionTTSettings settings, IndexerCapabilitiesCategories categories)
|
||||
public RevolutionTTParser(UserPassTorrentBaseSettings settings, IndexerCapabilitiesCategories categories)
|
||||
{
|
||||
_settings = settings;
|
||||
_categories = categories;
|
||||
@@ -327,41 +328,4 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
}
|
||||
|
||||
public class RevolutionTTSettingsValidator : AbstractValidator<RevolutionTTSettings>
|
||||
{
|
||||
public RevolutionTTSettingsValidator()
|
||||
{
|
||||
RuleFor(c => c.Username).NotEmpty();
|
||||
RuleFor(c => c.Password).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class RevolutionTTSettings : IIndexerSettings
|
||||
{
|
||||
private static readonly RevolutionTTSettingsValidator Validator = new RevolutionTTSettingsValidator();
|
||||
|
||||
public RevolutionTTSettings()
|
||||
{
|
||||
Username = "";
|
||||
Password = "";
|
||||
}
|
||||
|
||||
[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 = "Username", HelpText = "Site Username", Privacy = PrivacyLevel.UserName)]
|
||||
public string Username { get; set; }
|
||||
|
||||
[FieldDefinition(3, Label = "Password", HelpText = "Site Password", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
|
||||
public string Password { get; set; }
|
||||
|
||||
[FieldDefinition(4)]
|
||||
public IndexerBaseSettings BaseSettings { get; set; } = new IndexerBaseSettings();
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user