aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-03-11 11:03:41 -0400
committerEric Reed <ebr@mediabrowser3.com>2013-03-11 11:03:41 -0400
commit6470c62c5048dd22caff3a2f4cb296e7e0e5937a (patch)
treea566b28ca659291da99bdded88b4b366cc2572e1 /MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs
parent889bd32e9e798fe816f4ae1d0051e755c30eac5e (diff)
parent39020714f75b1bd1fe41355d4e9dadc9620ed8a1 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs33
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..b1677331a
--- /dev/null
+++ b/MediaBrowser.Server.Implementations/Sorting/RandomComparer.cs
@@ -0,0 +1,33 @@
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Sorting;
+using MediaBrowser.Model.Querying;
+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; }
+ }
+ }
+}