diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-06-05 19:40:28 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-06-07 23:06:37 +0200 |
| commit | fe1accc0e79885c5706babac5dea527d0b07d8e2 (patch) | |
| tree | cf2a727c9916e43363305a12902e825391ae1934 | |
| parent | 4459147788c0a11d3039723644708f8c8f7cdf2d (diff) | |
Prefer local alternate versions when deduplicating linked children
(cherry picked from commit 53f02a04ef7ff8f9d78c5f4e0924a0871b0e96fb)
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs b/Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs index ffa5cff1f2..7c0cfe7c15 100644 --- a/Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs +++ b/Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs @@ -557,9 +557,11 @@ public class ItemPersistenceService : IItemPersistenceService } } + // Deduplicate; local (file-based) relationships take priority over linked (user-merged) + // ones, matching the LinkedChildren migration. newLinkedChildren = newLinkedChildren .GroupBy(c => c.ChildId) - .Select(g => g.Last()) + .Select(g => g.OrderBy(c => c.Type == LinkedChildType.LocalAlternateVersion ? 0 : 1).First()) .ToList(); var childIdsToCheck = newLinkedChildren.Select(c => c.ChildId).ToList(); |
