mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 12:33:00 +02:00
WIP UI Update for adding lists.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NzbDrone.Common.EnsureThat;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Reflection;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Profiles;
|
||||
|
||||
namespace NzbDrone.Api.ClientSchema
|
||||
{
|
||||
@@ -147,6 +150,18 @@ namespace NzbDrone.Api.ClientSchema
|
||||
|
||||
private static List<SelectOption> GetSelectOptions(Type selectOptions)
|
||||
{
|
||||
if (selectOptions == typeof(Profile))
|
||||
{
|
||||
return new List<SelectOption>();
|
||||
}
|
||||
|
||||
if (selectOptions == typeof(Quality))
|
||||
{
|
||||
var qOptions = from Quality q in selectOptions.GetProperties(BindingFlags.Static | BindingFlags.Public)
|
||||
select new SelectOption {Name = q.Name, Value = q.Id};
|
||||
return qOptions.OrderBy(o => o.Value).ToList();
|
||||
}
|
||||
|
||||
var options = from Enum e in Enum.GetValues(selectOptions)
|
||||
select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() };
|
||||
|
||||
|
Reference in New Issue
Block a user