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/RandomComparer.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs (limited to 'MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs') diff --git a/MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs b/MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs new file mode 100644 index 000000000..e7e98a8a0 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs @@ -0,0 +1,33 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Sorting; +using MediaBrowser.Model.Dto; +using System; + +namespace MediaBrowser.Server.Implementations.Sorting +{ + /// + /// Class RandomComparer + /// + public class RandomComparer : IBaseItemComparer + { + /// + /// Compares the specified x. + /// + /// The x. + /// The y. + /// System.Int32. + public int Compare(BaseItem x, BaseItem y) + { + return Guid.NewGuid().CompareTo(Guid.NewGuid()); + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get { return ItemSortBy.Random; } + } + } +} -- cgit v1.2.3