Include specials in the calculation for the "Next Up" episode. Fixes #1479

This commit is contained in:
Moshe Schmidt
2021-02-17 21:18:27 +01:00
parent 64730b5661
commit 4bbfcaef83
3 changed files with 41 additions and 10 deletions

View File

@@ -131,11 +131,11 @@ namespace Emby.Server.Implementations.Sorting
return GetSpecialCompareValue(x).CompareTo(GetSpecialCompareValue(y));
}
private static int GetSpecialCompareValue(Episode item)
private static long GetSpecialCompareValue(Episode item)
{
// First sort by season number
// Since there are three sort orders, pad with 9 digits (3 for each, figure 1000 episode buffer should be enough)
var val = (item.AirsAfterSeasonNumber ?? item.AirsBeforeSeasonNumber ?? 0) * 1000000000;
var val = (item.AirsAfterSeasonNumber ?? item.AirsBeforeSeasonNumber ?? 0) * 1000000000L;
// Second sort order is if it airs after the season
if (item.AirsAfterSeasonNumber.HasValue)