From 8c52c065fbb8d59c8830e3737f177f456d646b3e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 14 Jul 2015 15:04:16 -0400 Subject: update people sorting --- MediaBrowser.Server.Implementations/Sorting/NameComparer.cs | 6 ++++++ MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs index 83b1b2d16..18fddb903 100644 --- a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; +using System; namespace MediaBrowser.Server.Implementations.Sorting { @@ -17,6 +18,11 @@ namespace MediaBrowser.Server.Implementations.Sorting /// System.Int32. public int Compare(BaseItem x, BaseItem y) { + if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting) + { + return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase); + } + return AlphanumComparator.CompareValues(x.Name, y.Name); } diff --git a/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs index e635cfbe5..389b21ba7 100644 --- a/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; +using System; namespace MediaBrowser.Server.Implementations.Sorting { @@ -17,6 +18,11 @@ namespace MediaBrowser.Server.Implementations.Sorting /// System.Int32. public int Compare(BaseItem x, BaseItem y) { + if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting) + { + return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase); + } + return AlphanumComparator.CompareValues(x.SortName, y.SortName); } -- cgit v1.2.3