aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-02-09 18:25:07 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-02-09 18:25:07 +0100
commitedec464306b8cba2177098042c2d57429853fd8d (patch)
tree746f525f3b7f17a94fbec43dd92df4623ae206d9
parent5dcec831f3bc83761d8170d25eab2cca310ae7cb (diff)
Handle episode versions in LinkedChild migration
-rw-r--r--Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs b/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs
index c1de002e38..82402cd88e 100644
--- a/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs
+++ b/Jellyfin.Server/Migrations/Routines/MigrateLinkedChildren.cs
@@ -48,7 +48,8 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine
var videoTypes = new[]
{
"MediaBrowser.Controller.Entities.Video",
- "MediaBrowser.Controller.Entities.Movies.Movie"
+ "MediaBrowser.Controller.Entities.Movies.Movie",
+ "MediaBrowser.Controller.Entities.TV.Episode"
};
var itemsWithData = context.BaseItems
@@ -78,7 +79,7 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine
{
using var doc = JsonDocument.Parse(item.Data);
- var isVideo = item.Type == "MediaBrowser.Controller.Entities.Video" || item.Type == "MediaBrowser.Controller.Entities.Movies.Movie";
+ var isVideo = videoTypes.Contains(item.Type);
// Handle Video alternate versions
if (isVideo)
@@ -235,8 +236,6 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine
// but the parent is a more specific type (like Movie).
// Since IDs are computed from type + path, just updating the Type column would break ID lookups.
// Instead, delete them and let the runtime recreate them with the correct type during the next library scan.
- var genericVideoType = "MediaBrowser.Controller.Entities.Video";
-
var wrongTypeChildIds = context.LinkedChildren
.Where(lc => lc.ChildType == LinkedChildType.LocalAlternateVersion)
.Join(
@@ -249,7 +248,7 @@ internal class MigrateLinkedChildren : IDatabaseMigrationRoutine
x => x.ChildId,
child => child.Id,
(x, child) => new { x.ChildId, x.ParentType, ChildType = child.Type })
- .Where(x => x.ChildType == genericVideoType && x.ParentType != genericVideoType)
+ .Where(x => x.ChildType != x.ParentType)
.Select(x => x.ChildId)
.Distinct()
.ToList();