aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2026-06-08 19:41:39 +0200
committerGitHub <noreply@github.com>2026-06-08 19:41:39 +0200
commit97fd210cd38b26bceed3b601e2a8797d070a5b02 (patch)
treea2c0f6f6720aa37da6dc8d628f7b1723e4249d6a /Jellyfin.Server.Implementations
parent1a786f26c1e800550e823751f08581167edbdfc1 (diff)
parentf5847596384c35b5bf4119cd8b39e4234af6e899 (diff)
Merge pull request #17042 from Shadowghost/linked-children-local-alternate-priority
Prefer local alternate versions when deduplicating linked children
Diffstat (limited to 'Jellyfin.Server.Implementations')
-rw-r--r--Jellyfin.Server.Implementations/Item/ItemPersistenceService.cs4
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();