aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-18 09:54:38 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-18 09:54:38 -0400
commitdea10e5040e165444b7ab3990a92b62604025d3b (patch)
tree99e2ff7736af45656b60f07e59770e976f2589b6 /MediaBrowser.Server.Implementations/Sorting
parentaa8c3d9cf0dd7d10f712c6a81cb5a3b3c7658e92 (diff)
Capture revenue and add it as a sort order
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting')
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs29
2 files changed, 30 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs b/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs
index 3637f2939..39bdc6363 100644
--- a/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/BudgetComparer.cs
@@ -4,7 +4,7 @@ using MediaBrowser.Model.Querying;
namespace MediaBrowser.Server.Implementations.Sorting
{
- public class BudgetDateComparer : IBaseItemComparer
+ public class BudgetComparer : IBaseItemComparer
{
/// <summary>
/// Compares the specified x.
diff --git a/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs
new file mode 100644
index 000000000..8764c97d0
--- /dev/null
+++ b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs
@@ -0,0 +1,29 @@
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Sorting;
+using MediaBrowser.Model.Querying;
+
+namespace MediaBrowser.Server.Implementations.Sorting
+{
+ public class RevenueComparer : 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 (x.Revenue ?? 0).CompareTo(y.Revenue ?? 0);
+ }
+
+ /// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name
+ {
+ get { return ItemSortBy.Revenue; }
+ }
+ }
+}