diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-07-14 15:04:16 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-07-14 15:04:16 -0400 |
| commit | 8c52c065fbb8d59c8830e3737f177f456d646b3e (patch) | |
| tree | 02779c1e628a2510f712c5c358a04edaa123d9ab /MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs | |
| parent | 7736bab31400073daa64df3d4b283c26fcb9ee3e (diff) | |
update people sorting
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs | 6 |
1 files changed, 6 insertions, 0 deletions
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 /// <returns>System.Int32.</returns> 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); } |
