Capture revenue and add it as a sort order

This commit is contained in:
Luke Pulverenti
2013-04-18 09:54:38 -04:00
parent aa8c3d9cf0
commit dea10e5040
11 changed files with 62 additions and 4 deletions

View File

@@ -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.

View File

@@ -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; }
}
}
}