aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-07-29 07:31:27 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-07-29 07:31:27 +0200
commit7a4271c85f98cfb4ebbe00e9786d17577330beac (patch)
treec36dae5e05b0eed421efb366f1bfde5e04327fde /Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
parentd92e59aa72e6872fb004282b432c70034ecec8ac (diff)
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.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs b/Jellyfin.Server.Implementations/Item/BaseItemMapper.cs
index c64e6ac068..fe202b69ff 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
+ .Where(e => e.ChildType is Database.Implementations.Entities.LinkedChildType.LinkedAlternateVersion
+ or Database.Implementations.Entities.LinkedChildType.AutoLinkedAlternateVersion)
+ .OrderBy(e => e.SortOrder)
+ .Select(e => new LinkedChild
+ {
+ ItemId = e.ChildId,
+ Type = (MediaBrowser.Controller.Entities.LinkedChildType)e.ChildType
+ })
+ .ToArray();
+ }
}
if (dto is IHasSeries hasSeriesName)