update people sorting

This commit is contained in:
Luke Pulverenti
2015-07-14 15:04:16 -04:00
parent 7736bab314
commit 8c52c065fb
8 changed files with 236 additions and 613 deletions

View File

@@ -235,6 +235,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public virtual bool EnableAlphaNumericSorting
{
get
{
return true;
}
}
/// <summary>
/// This is just a helper for convenience
/// </summary>
@@ -439,6 +448,11 @@ namespace MediaBrowser.Controller.Entities
{
if (Name == null) return null; //some items may not have name filled in properly
if (!EnableAlphaNumericSorting)
{
return Name.TrimStart();
}
var sortable = Name.Trim().ToLower();
sortable = ConfigurationManager.Configuration.SortRemoveCharacters.Aggregate(sortable, (current, search) => current.Replace(search.ToLower(), string.Empty));