New: (Avistaz) Freeleech Only Setting

#1108
This commit is contained in:
Qstick
2022-09-12 21:16:05 -05:00
parent 33de7ca7ab
commit 68df439498
2 changed files with 9 additions and 0 deletions

View File

@@ -34,6 +34,11 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
{ "type", categoryMapping.Any() ? categoryMapping.First() : "0" }
};
if (Settings.FreeleechOnly)
{
qc.Add("discount[]", "1");
}
// resolution filter to improve the search
if (!categories.Contains(NewznabStandardCategory.Movies.Id) && !categories.Contains(NewznabStandardCategory.TV.Id) &&
!categories.Contains(NewznabStandardCategory.Audio.Id))

View File

@@ -22,6 +22,7 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
public AvistazSettings()
{
Token = "";
FreeleechOnly = false;
}
public string Token { get; set; }
@@ -35,6 +36,9 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
[FieldDefinition(4, Label = "PID", HelpText = "PID from My Account or My Profile page")]
public string Pid { get; set; }
[FieldDefinition(5, Label = "Freeleech Only", HelpText = "Search freeleech only")]
public bool FreeleechOnly { get; set; }
public override NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));