mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added the settings for #925 but need to apply the settings to the UI
This commit is contained in:
parent
32f044b4da
commit
bef6e036f7
10 changed files with 335 additions and 36 deletions
|
@ -82,6 +82,19 @@ namespace Ombi.Helpers
|
|||
if (descriptionAttributes == null) return string.Empty;
|
||||
return (descriptionAttributes.Length > 0) ? descriptionAttributes[0].Name : value.ToString();
|
||||
}
|
||||
public static string GetDisplayDescription(T value)
|
||||
{
|
||||
var fieldInfo = value.GetType().GetField(value.ToString());
|
||||
|
||||
var descriptionAttributes = fieldInfo.GetCustomAttributes(
|
||||
typeof(DisplayAttribute), false) as DisplayAttribute[];
|
||||
|
||||
if (descriptionAttributes[0].ResourceType != null)
|
||||
return LookupResource(descriptionAttributes[0].ResourceType, descriptionAttributes[0].Description);
|
||||
|
||||
if (descriptionAttributes == null) return string.Empty;
|
||||
return (descriptionAttributes.Length > 0) ? descriptionAttributes[0].Description : value.ToString();
|
||||
}
|
||||
|
||||
public static T GetValueFromName(string name)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue