mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 03:57:12 +00:00
improved performance of item counts
This commit is contained in:
@@ -14,7 +14,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
return (x.Budget ?? 0).CompareTo(y.Budget ?? 0);
|
||||
return GetValue(x).CompareTo(GetValue(y));
|
||||
}
|
||||
|
||||
private double GetValue(BaseItem x)
|
||||
{
|
||||
return x.Budget ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,7 +17,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
return (x.CriticRating ?? 0).CompareTo(y.CriticRating ?? 0);
|
||||
return GetValue(x).CompareTo(GetValue(y));
|
||||
}
|
||||
|
||||
private float GetValue(BaseItem x)
|
||||
{
|
||||
return x.CriticRating ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -14,7 +14,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
return (x.Revenue ?? 0).CompareTo(y.Revenue ?? 0);
|
||||
return GetValue(x).CompareTo(GetValue(y));
|
||||
}
|
||||
|
||||
private double GetValue(BaseItem x)
|
||||
{
|
||||
return x.Revenue ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user