aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/Search
diff options
context:
space:
mode:
authorbrandon <brandon@clinger.dev>2026-08-07 11:59:17 -0400
committerbrandon <brandon@clinger.dev>2026-08-07 11:59:17 -0400
commitd6da6906a4b3426f05c5bf4ffe8bab4b2bc78ce8 (patch)
tree78683665d1792916de8683b6ac5bc13e17904d87 /Emby.Server.Implementations/Library/Search
parent6c37a6ef8b4ce027e7ac2aaa827244711cf5f39c (diff)
Batch people lookups when building item DTOs
GetBaseItemDtos already batch fetches user data, child counts, played counts and artists before its per item loop, but AttachPeople still ran one GetPeople query per item. Rendering a page of items (for example a large playlist) fired one extra query per row. Add GetPeopleByItems to IPeopleRepository, which reads every requested item in a single query over the people mapping table and returns full PersonInfo (role, type and sort order) grouped by item id. GetBaseItemDtos prefetches this once when the People field is requested and passes it into AttachPeople, which reads from the batch instead of querying per item. The single item GetBaseItemDto path keeps its existing per item behaviour when no batch is supplied. Adds a DtoService test asserting people resolve from the batch and the per item GetPeople is never called.
Diffstat (limited to 'Emby.Server.Implementations/Library/Search')
0 files changed, 0 insertions, 0 deletions