diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-08-02 14:24:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-02 14:24:05 -0400 |
| commit | 044f6512997f24f7f9fc92df7e77bd0e98e5be25 (patch) | |
| tree | 6fdcbab77aec6709b5f27d347768cebad249cccd /Jellyfin.Server.Implementations/Item/BaseItemMapper.cs | |
| parent | f865910a908ba36c5adfd7d6b394ec239077c31e (diff) | |
| parent | 1f4f4acb466153b698284bd31cf27d508fe72cb5 (diff) | |
Merge pull request #17482 from Shadowghost/fix-stale-versions
Fix video version links being read from stale serialised item data instead of the LinkedChildren table
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/BaseItemMapper.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/BaseItemMapper.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs b/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs index 958d11e21e..c2cb644c59 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs @@ -134,6 +134,21 @@ public static class BaseItemMapper if (dto is Video video) { video.PrimaryVersionId = entity.PrimaryVersionId; + + // The LinkedChildren table is the source of truth for version links + if (entity.LinkedChildEntities is not null) + { + video.LinkedAlternateVersions = entity.LinkedChildEntities + // LocalAlternateVersion links belong to Video.LocalAlternateVersions, not here + .Where(e => e.ChildType == Database.Implementations.Entities.LinkedChildType.LinkedAlternateVersion) + .OrderBy(e => e.SortOrder) + .Select(e => new LinkedChild + { + ItemId = e.ChildId, + Type = (MediaBrowser.Controller.Entities.LinkedChildType)e.ChildType + }) + .ToArray(); + } } if (dto is IHasSeries hasSeriesName) |
