mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added HDBits Category, Codec, and Medium Filtering Capability (#1458)
* Added advanced configuration options to support filtering Categories, Codecs, and Medium to the HDBits indexer. * Changes to use the existing tags with a controlled vocabulary. * 1) Sorting select options by name 2) Moved the autocomplete tag code into taginput as requested * removed commented out line * require cleanups
This commit is contained in:

committed by
Leonardo Galli

parent
86634006e5
commit
3d48da2111
@@ -46,7 +46,7 @@ namespace NzbDrone.Api.ClientSchema
|
||||
field.Value = value;
|
||||
}
|
||||
|
||||
if (fieldAttribute.Type == FieldType.Select)
|
||||
if (fieldAttribute.Type == FieldType.Select || fieldAttribute.Type == FieldType.Tag)
|
||||
{
|
||||
field.SelectOptions = GetSelectOptions(fieldAttribute.SelectOptions);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ namespace NzbDrone.Api.ClientSchema
|
||||
|
||||
private static List<SelectOption> GetSelectOptions(Type selectOptions)
|
||||
{
|
||||
if (selectOptions == typeof(Profile))
|
||||
if (selectOptions == null || selectOptions == typeof(Profile))
|
||||
{
|
||||
return new List<SelectOption>();
|
||||
}
|
||||
@@ -165,7 +165,7 @@ namespace NzbDrone.Api.ClientSchema
|
||||
var options = from Enum e in Enum.GetValues(selectOptions)
|
||||
select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() };
|
||||
|
||||
return options.OrderBy(o => o.Value).ToList();
|
||||
return options.OrderBy(o => o.Name).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user