diff --git a/Shokofin/API/Info/ShowInfo.cs b/Shokofin/API/Info/ShowInfo.cs index 56e17c62..3e9e9779 100644 --- a/Shokofin/API/Info/ShowInfo.cs +++ b/Shokofin/API/Info/ShowInfo.cs @@ -135,7 +135,7 @@ public ShowInfo(SeasonInfo seasonInfo, string? collectionId = null) { var seasonNumberBaseDictionary = new Dictionary(); var seasonOrderDictionary = new Dictionary(); - var seasonNumberOffset = 0; + var seasonNumberOffset = 1; if (seasonInfo.EpisodeList.Count > 0 || seasonInfo.AlternateEpisodesList.Count > 0) seasonNumberBaseDictionary.Add(seasonInfo.Id, seasonNumberOffset); if (seasonInfo.EpisodeList.Count > 0) diff --git a/Shokofin/Utils/Ordering.cs b/Shokofin/Utils/Ordering.cs index 4962fd84..cab7af5c 100644 --- a/Shokofin/Utils/Ordering.cs +++ b/Shokofin/Utils/Ordering.cs @@ -216,8 +216,11 @@ public static (int?, int?, int?, bool) GetSpecialPlacement(ShowInfo showInfo, Se /// public static int GetSeasonNumber(ShowInfo showInfo, SeasonInfo seasonInfo, EpisodeInfo episodeInfo) { - if (!showInfo.TryGetBaseSeasonNumberForSeasonInfo(seasonInfo, out var seasonNumber)) + if (!showInfo.TryGetBaseSeasonNumberForSeasonInfo(seasonInfo, out var seasonNumber)) { + if (showInfo.IsSpecial(episodeInfo)) + return 0; throw new System.IndexOutOfRangeException($"Series is not part of the provided group. (Group={showInfo.GroupId},Series={seasonInfo.Id})"); + } if (seasonInfo.AlternateEpisodesList.Any(ep => ep.Id == episodeInfo.Id)) return seasonNumber + 1;