aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
diff options
context:
space:
mode:
authorTavares André <tavares_and@hotmail.com>2015-07-16 20:19:12 +0200
committerTavares André <tavares_and@hotmail.com>2015-07-16 20:19:12 +0200
commit8fd5a8af8d8b6d371a0a2c44d0c7c6809410125c (patch)
treec23e4a4afc33c35318eb2a26f51b28d3a6bb35da /MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
parent0fa55fd6de42b683bcdcc0c632f4db1436bca36d (diff)
parentf1ad56a7deaef79f6dcb2b871de727b8e4af3371 (diff)
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/NameComparer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/NameComparer.cs6
1 files changed, 6 insertions, 0 deletions
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
/// <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.Name, y.Name);
}