mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Added a release notes page, you can access via Admin>Updates>Recent Changes tab. Note to self, need to put better comments in for users to understand!
This commit is contained in:
parent
14ac399886
commit
2804191781
14 changed files with 451 additions and 70 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 BranchAttribute GetBranchValue<U>(T value) where U : BranchAttribute
|
||||
{
|
||||
var fieldInfo = value.GetType().GetField(value.ToString());
|
||||
|
||||
var descriptionAttributes = fieldInfo.GetCustomAttributes(
|
||||
typeof(BranchAttribute), false) as BranchAttribute[];
|
||||
|
||||
return descriptionAttributes?.FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static string GetDisplayDescription(T value)
|
||||
{
|
||||
var fieldInfo = value.GetType().GetField(value.ToString());
|
||||
|
@ -127,4 +140,9 @@ namespace Ombi.Helpers
|
|||
return Enum.GetValues(typeof(T)).Cast<int>().Sum();
|
||||
}
|
||||
}
|
||||
public class BranchAttribute : Attribute
|
||||
{
|
||||
public string DisplayName { get; set; }
|
||||
public string BranchName { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue