mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 08:47:59 +02:00
New: (HDBits) Filter by origins
This commit is contained in:
@@ -17,7 +17,7 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
public IEnumerable<int> Category { get; set; }
|
||||
public IEnumerable<int> Codec { get; set; }
|
||||
public IEnumerable<int> Medium { get; set; }
|
||||
public int? Origin { get; set; }
|
||||
public IEnumerable<int> Origin { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "imdb")]
|
||||
public ImdbInfo ImdbInfo { get; set; }
|
||||
|
@@ -123,8 +123,20 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
query.Username = Settings.Username;
|
||||
query.Passkey = Settings.ApiKey;
|
||||
|
||||
query.Codec = Settings.Codecs.ToArray();
|
||||
query.Medium = Settings.Mediums.ToArray();
|
||||
if (Settings.Codecs.Any())
|
||||
{
|
||||
query.Codec = Settings.Codecs.ToArray();
|
||||
}
|
||||
|
||||
if (Settings.Mediums.Any())
|
||||
{
|
||||
query.Medium = Settings.Mediums.ToArray();
|
||||
}
|
||||
|
||||
if (Settings.Origins.Any())
|
||||
{
|
||||
query.Origin = Settings.Origins.ToArray();
|
||||
}
|
||||
|
||||
if (searchCriteria.Categories?.Length > 0)
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
{
|
||||
Codecs = Array.Empty<int>();
|
||||
Mediums = Array.Empty<int>();
|
||||
Origins = Array.Empty<int>();
|
||||
FreeleechOnly = false;
|
||||
UseFilenames = true;
|
||||
}
|
||||
@@ -34,16 +35,19 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
[FieldDefinition(3, Label = "API Key", HelpText = "Site API Key", Privacy = PrivacyLevel.ApiKey)]
|
||||
public string ApiKey { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Codecs", Type = FieldType.Select, SelectOptions = typeof(HdBitsCodec), Advanced = true, HelpText = "If unspecified, all options are used.")]
|
||||
[FieldDefinition(4, Label = "Codecs", Type = FieldType.Select, SelectOptions = typeof(HdBitsCodec), HelpText = "If unspecified, all options are used.", Advanced = true)]
|
||||
public IEnumerable<int> Codecs { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Mediums", Type = FieldType.Select, SelectOptions = typeof(HdBitsMedium), Advanced = true, HelpText = "If unspecified, all options are used.")]
|
||||
[FieldDefinition(5, Label = "Mediums", Type = FieldType.Select, SelectOptions = typeof(HdBitsMedium), HelpText = "If unspecified, all options are used.", Advanced = true)]
|
||||
public IEnumerable<int> Mediums { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Freeleech Only", Type = FieldType.Checkbox, Advanced = true, HelpText = "Show freeleech releases only")]
|
||||
[FieldDefinition(6, Label = "Origins", Type = FieldType.Select, SelectOptions = typeof(HdBitsOrigin), HelpText = "If unspecified, all options are used.", Advanced = true)]
|
||||
public IEnumerable<int> Origins { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Show freeleech releases only", Advanced = true)]
|
||||
public bool FreeleechOnly { get; set; }
|
||||
|
||||
[FieldDefinition(7, Label = "Use Filenames", Type = FieldType.Checkbox, HelpText = "Check this option if you want to use torrent filenames as release titles")]
|
||||
[FieldDefinition(8, Label = "Use Filenames", Type = FieldType.Checkbox, HelpText = "Check this option if you want to use torrent filenames as release titles")]
|
||||
public bool UseFilenames { get; set; }
|
||||
|
||||
public override NzbDroneValidationResult Validate()
|
||||
@@ -79,4 +83,12 @@ namespace NzbDrone.Core.Indexers.Definitions.HDBits
|
||||
[FieldOption("WEB-DL")]
|
||||
WebDl = 6
|
||||
}
|
||||
|
||||
public enum HdBitsOrigin
|
||||
{
|
||||
[FieldOption("Undefined")]
|
||||
Undefined = 0,
|
||||
[FieldOption("Internal")]
|
||||
Internal = 1
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user