From 505a6ebf8f4a36a2deb8e2a7cff3809643e8f654 Mon Sep 17 00:00:00 2001 From: brandon Date: Sat, 8 Aug 2026 15:20:39 -0400 Subject: Use WhereOneOrMany helper for the alternate version id filter Filter the parent ids with the WhereOneOrMany query helper instead of a raw Contains so the id list is wrapped in EF.Parameter and EF Core reuses one compiled query plan across calls, matching how the rest of the item queries build their id filters. --- Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs index a96e941c88..d46f7b3c4c 100644 --- a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs +++ b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs @@ -70,9 +70,9 @@ public class LinkedChildrenService : ILinkedChildrenService using var dbContext = _dbProvider.CreateDbContext(); return dbContext.LinkedChildren - .Where(lc => (lc.ChildType == DbLinkedChildType.LocalAlternateVersion - || lc.ChildType == DbLinkedChildType.LinkedAlternateVersion) - && itemIds.Contains(lc.ParentId)) + .Where(lc => lc.ChildType == DbLinkedChildType.LocalAlternateVersion + || lc.ChildType == DbLinkedChildType.LinkedAlternateVersion) + .WhereOneOrMany(itemIds as IList ?? itemIds.ToList(), lc => lc.ParentId) .Select(lc => lc.ParentId) .Distinct() .ToHashSet(); -- cgit v1.2.3