From 737abe6f3a48a1fa792ff2d24dad45a04880717f Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 9 Feb 2026 09:13:05 +0100 Subject: [PATCH] Fix version order in migration --- .../Migrations/Routines/MigrateLinkedChildren.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs b/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs index 9dfb8be900..c1de002e38 100644 --- a/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs +++ b/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs @@ -315,6 +315,8 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine Dictionary pathToIdMap, List linkedChildrenToAdd) { + int sortOrder = 0; + if (root.TryGetProperty("LocalAlternateVersions", out var localAlternateVersionsElement) && localAlternateVersionsElement.ValueKind == JsonValueKind.Array) { @@ -339,7 +341,7 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine ParentId = parentId, ChildId = childId, ChildType = LinkedChildType.LocalAlternateVersion, - SortOrder = null + SortOrder = sortOrder++ }); _logger.LogDebug( @@ -412,7 +414,7 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine ParentId = parentId, ChildId = childId.Value, ChildType = LinkedChildType.LinkedAlternateVersion, - SortOrder = null + SortOrder = sortOrder++ }); _logger.LogDebug(