diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-09 23:22:36 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-09 23:22:36 -0500 |
| commit | 31d079f1baea895b5cb0f1a737140ab94dc9a4fe (patch) | |
| tree | 1ed702bbed6edb1cc7f505c92e42a4263b1f8ed3 /MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs | |
| parent | 913cb3c564e58dd440dbf3af81f38aad68c1ac2a (diff) | |
unified the two sorting api's
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs | 33 |
1 files changed, 33 insertions, 0 deletions
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 +{ + /// <summary> + /// Class RandomComparer + /// </summary> + public class RandomComparer : IBaseItemComparer + { + /// <summary> + /// Compares the specified x. + /// </summary> + /// <param name="x">The x.</param> + /// <param name="y">The y.</param> + /// <returns>System.Int32.</returns> + public int Compare(BaseItem x, BaseItem y) + { + return Guid.NewGuid().CompareTo(Guid.NewGuid()); + } + + /// <summary> + /// Gets the name. + /// </summary> + /// <value>The name.</value> + public string Name + { + get { return ItemSortBy.Random; } + } + } +} |
