diff options
| author | brandon <brandon@clinger.dev> | 2026-08-08 12:33:11 -0400 |
|---|---|---|
| committer | brandon <brandon@clinger.dev> | 2026-08-08 12:33:11 -0400 |
| commit | 10d108a1f453c0972b3059e10bb9b13bbcb34f63 (patch) | |
| tree | b00f02ff96a21a78b35ca69ef5614466e0afc3ca /Jellyfin.Server.Implementations | |
| parent | c091ffdc6b2d8d4dd6f439d056c561bae7bd9a18 (diff) | |
Address review on MediaSourceCount batching
Rename GetItemsWithAlternateVersions to GetItemIdsWithAlternateVersions
across the interfaces and implementations since it returns ids. Return
the hashset straight from the query instead of materializing an array
first. Rename the DtoService guard to mayHaveAlternateVersions and
invert it so the computed path is the explicit case. Assert the media
source count value in the batch skip test and add a test covering an
item that is in the returned set still resolving to the correct count.
Diffstat (limited to 'Jellyfin.Server.Implementations')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs index 2452f8e3c6..a96e941c88 100644 --- a/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs +++ b/Jellyfin.Server.Implementations/Item/LinkedChildrenService.cs @@ -60,7 +60,7 @@ public class LinkedChildrenService : ILinkedChildrenService } /// <inheritdoc/> - public IReadOnlySet<Guid> GetItemsWithAlternateVersions(IReadOnlyList<Guid> itemIds) + public IReadOnlySet<Guid> GetItemIdsWithAlternateVersions(IReadOnlyList<Guid> itemIds) { if (itemIds.Count == 0) { @@ -69,15 +69,13 @@ public class LinkedChildrenService : ILinkedChildrenService using var dbContext = _dbProvider.CreateDbContext(); - var parentIds = dbContext.LinkedChildren + return dbContext.LinkedChildren .Where(lc => (lc.ChildType == DbLinkedChildType.LocalAlternateVersion || lc.ChildType == DbLinkedChildType.LinkedAlternateVersion) && itemIds.Contains(lc.ParentId)) .Select(lc => lc.ParentId) .Distinct() - .ToArray(); - - return parentIds.ToHashSet(); + .ToHashSet(); } /// <inheritdoc/> |
