diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-07-16 09:00:03 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-07-16 09:00:03 -0400 |
| commit | 087b9c6fd2bfbbd10a4fcbfe335550beb9085a04 (patch) | |
| tree | c474f1d70d4cdbc513034dc3832e4d266719ddea /MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs | |
| parent | 2022c5631fe18996b23330a58133cb18d1e9600e (diff) | |
| parent | c6a64efab781269f9dc512282f27f2a2d3fdb1f2 (diff) | |
Merge pull request #1140 from MediaBrowser/dev
3.0.5675.1
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); } |
