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.
Prowlarr/src/NzbDrone.Core/Indexers/Definitions/Gazelle/GazelleSettings.cs

39 lines
1.2 KiB

using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers.Settings;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions.Gazelle;
public class GazelleSettingsValidator<T> : UserPassBaseSettingsValidator<T>
where T : GazelleSettings
{
}
public class GazelleSettings : UserPassTorrentBaseSettings
{
private static readonly GazelleSettingsValidator<GazelleSettings> Validator = new ();
public string AuthKey { get; set; }
public string PassKey { get; set; }
[FieldDefinition(3, Type = FieldType.Select, Label = "Use Freeleech Tokens", SelectOptions = typeof(GazelleUseFreeleechTokens), HelpText = "When to use freeleech tokens")]
public int UseFreeleechToken { get; set; }
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
internal enum GazelleUseFreeleechTokens
{
[FieldOption(Label = "Never", Hint = "Do not use tokens")]
Never = 0,
[FieldOption(Label = "Preferred", Hint = "Use token if possible")]
Preferred = 1,
[FieldOption(Label = "Required", Hint = "Abort download if unable to use token")]
Required = 2,
}