Update Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
parent
2b5f3f294e
commit
96bc24b1dc
|
@ -146,12 +146,11 @@ namespace Emby.Server.Implementations.Sorting
|
||||||
{
|
{
|
||||||
var xValue = ((x.ParentIndexNumber ?? -1) * 1000) + (x.IndexNumber ?? -1);
|
var xValue = ((x.ParentIndexNumber ?? -1) * 1000) + (x.IndexNumber ?? -1);
|
||||||
var yValue = ((y.ParentIndexNumber ?? -1) * 1000) + (y.IndexNumber ?? -1);
|
var yValue = ((y.ParentIndexNumber ?? -1) * 1000) + (y.IndexNumber ?? -1);
|
||||||
var compare_val = xValue.CompareTo(yValue);
|
var comparisonResult = xValue.CompareTo(yValue);
|
||||||
if (compare_val == 0)
|
// If equal, compare premiere dates
|
||||||
|
if (comparisonResult == 0 && x.PremiereDate.HasValue && y.PremiereDate.HasValue)
|
||||||
{
|
{
|
||||||
if (x.PremiereDate.HasValue & y.PremiereDate.HasValue)
|
comparisonResult = DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value);
|
||||||
{
|
|
||||||
compare_val = DateTime.Compare(x.PremiereDate.Value, y.PremiereDate.Value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user