aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index abd6e4262..d9dbf265f 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -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));