mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-20 22:14:34 -04:00
26bea14137
Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com>
34 lines
967 B
C#
34 lines
967 B
C#
using FluentValidation;
|
|
using NzbDrone.Core.Annotations;
|
|
using NzbDrone.Core.Validation;
|
|
|
|
namespace NzbDrone.Core.Indexers.Settings
|
|
{
|
|
public class CookieBaseSettingsValidator<T> : NoAuthSettingsValidator<T>
|
|
where T : CookieTorrentBaseSettings
|
|
{
|
|
public CookieBaseSettingsValidator()
|
|
{
|
|
RuleFor(c => c.Cookie).NotEmpty();
|
|
}
|
|
}
|
|
|
|
public class CookieTorrentBaseSettings : NoAuthTorrentBaseSettings
|
|
{
|
|
private static readonly CookieBaseSettingsValidator<CookieTorrentBaseSettings> Validator = new ();
|
|
|
|
public CookieTorrentBaseSettings()
|
|
{
|
|
Cookie = "";
|
|
}
|
|
|
|
[FieldDefinition(2, Label = "Cookie", HelpText = "Site Cookie", Privacy = PrivacyLevel.Password)]
|
|
public string Cookie { get; set; }
|
|
|
|
public override NzbDroneValidationResult Validate()
|
|
{
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
}
|
|
}
|
|
}
|