aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/TvShowsController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Controllers/TvShowsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/TvShowsController.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/TvShowsController.cs b/Jellyfin.Api/Controllers/TvShowsController.cs
index 340a54e13b..6b0f10e02a 100644
--- a/Jellyfin.Api/Controllers/TvShowsController.cs
+++ b/Jellyfin.Api/Controllers/TvShowsController.cs
@@ -277,8 +277,15 @@ public class TvShowsController : BaseJellyfinApiController
if (startItemId.HasValue)
{
+ // The start item may be an alternate version, which is not part of the episode listing; start from its primary episode instead.
+ var startId = startItemId.Value;
+ if (_libraryManager.GetItemById<Video>(startId)?.PrimaryVersionId is { } primaryVersionId)
+ {
+ startId = primaryVersionId;
+ }
+
episodes = episodes
- .SkipWhile(i => !startItemId.Value.Equals(i.Id))
+ .SkipWhile(i => !startId.Equals(i.Id))
.ToList();
}