aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Sorting
diff options
context:
space:
mode:
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 3637f29396..39bdc63630 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 0000000000..8764c97d0e
--- /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; }
+ }
+ }
+}