aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-07-16 09:00:03 -0400
committerLuke <luke.pulverenti@gmail.com>2015-07-16 09:00:03 -0400
commit087b9c6fd2bfbbd10a4fcbfe335550beb9085a04 (patch)
treec474f1d70d4cdbc513034dc3832e4d266719ddea /MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs
parent2022c5631fe18996b23330a58133cb18d1e9600e (diff)
parentc6a64efab781269f9dc512282f27f2a2d3fdb1f2 (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.cs6
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);
}