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:
randellhodges
2017-05-29 10:56:16 -05:00
committed by Leonardo Galli
parent 86634006e5
commit 3d48da2111
7 changed files with 129 additions and 52 deletions

View File

@@ -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();
}
}
}