From 31d079f1baea895b5cb0f1a737140ab94dc9a4fe Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sat, 9 Mar 2013 23:22:36 -0500 Subject: unified the two sorting api's --- .../Sorting/SortNameComparer.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs (limited to 'MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs') diff --git a/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs new file mode 100644 index 000000000..067f8c453 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs @@ -0,0 +1,33 @@ +using MediaBrowser.Controller.Entities; +using System; +using MediaBrowser.Controller.Sorting; +using MediaBrowser.Model.Dto; + +namespace MediaBrowser.Server.Implementations.Sorting +{ + /// + /// Class SortNameComparer + /// + public class SortNameComparer : IBaseItemComparer + { + /// + /// Compares the specified x. + /// + /// The x. + /// The y. + /// System.Int32. + public int Compare(BaseItem x, BaseItem y) + { + return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase); + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get { return ItemSortBy.SortName; } + } + } +} -- cgit v1.2.3