mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Add exclusive only
This commit is contained in:
parent
758cae3f40
commit
80425f5ea4
3 changed files with 18 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ public class TorrentQuery
|
|||
public IEnumerable<int> Codec { get; set; }
|
||||
public IEnumerable<int> Medium { get; set; }
|
||||
public IEnumerable<int> Origin { get; set; }
|
||||
public IEnumerable<int> Exclusive { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "imdb")]
|
||||
public ImdbInfo ImdbInfo { get; set; }
|
||||
|
|
|
|||
|
|
@ -138,6 +138,11 @@ private IEnumerable<IndexerRequest> GetRequest(TorrentQuery query, SearchCriteri
|
|||
query.Origin = Settings.Origins.ToArray();
|
||||
}
|
||||
|
||||
if (Settings.Exclusive.Any())
|
||||
{
|
||||
query.Exclusive = Settings.Exclusive.ToArray();
|
||||
}
|
||||
|
||||
if (searchCriteria.Categories?.Length > 0)
|
||||
{
|
||||
query.Category = Capabilities.Categories
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public HDBitsSettings()
|
|||
Origins = Array.Empty<int>();
|
||||
FreeleechOnly = false;
|
||||
UseFilenames = true;
|
||||
Exclusive = Array.Empty<int>();
|
||||
}
|
||||
|
||||
[FieldDefinition(2, Label = "Username", HelpText = "IndexerHDBitsSettingsUsernameHelpText", Privacy = PrivacyLevel.UserName)]
|
||||
|
|
@ -50,6 +51,9 @@ public HDBitsSettings()
|
|||
[FieldDefinition(8, Label = "IndexerHDBitsSettingsUseFilenames", Type = FieldType.Checkbox, HelpText = "IndexerHDBitsSettingsUseFilenamesHelpText")]
|
||||
public bool UseFilenames { get; set; }
|
||||
|
||||
[FieldDefinition(9, Label = "Exclusivities", Type = FieldType.Select, SelectOptions = typeof(HdBitsExclusive), HelpText = "If unspecified, all options are used.", Advanced = true)]
|
||||
public IEnumerable<int> Exclusive { get; set; }
|
||||
|
||||
public override NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
|
|
@ -91,4 +95,12 @@ public enum HdBitsOrigin
|
|||
[FieldOption("Internal")]
|
||||
Internal = 1
|
||||
}
|
||||
|
||||
public enum HdBitsExclusive
|
||||
{
|
||||
[FieldOption("Non-exclusive")]
|
||||
NonExclusive = 0,
|
||||
[FieldOption("Exclusive")]
|
||||
Exclusive = 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue