aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrandon <brandon@clinger.dev>2026-08-08 15:20:39 -0400
committerbrandon <brandon@clinger.dev>2026-08-08 15:20:39 -0400
commit505a6ebf8f4a36a2deb8e2a7cff3809643e8f654 (patch)
tree9614fc9bf9374693c9acc235989c7abc1904cd9b
parent10d108a1f453c0972b3059e10bb9b13bbcb34f63 (diff)
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.
-rw-r--r--Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs6
1 files 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<Guid> ?? itemIds.ToList(), lc => lc.ParentId)
.Select(lc => lc.ParentId)
.Distinct()
.ToHashSet();