Commit Graph

6 Commits

Author SHA1 Message Date
brandon d6da6906a4 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.
2026-08-07 11:59:17 -04:00
Tim Eisele 63d1af5fe7 Fix similarity (#16942)
Fix similarity
2026-05-31 17:21:15 +02:00
Shadowghost 97c20e6ac5 Fix movie recommendations 2026-05-15 14:37:01 +02:00
dkanada ec990be12a fix person TotalRecordCount when limit is applied 2026-05-04 12:06:11 +09:00
JPVenson 473628ba3a Apply suggestions from code review
Co-authored-by: Cody Robibero <cody@robibe.ro>
2024-10-09 21:03:57 +02:00
JPVenson be48cdd9e9 Naming refactoring and WIP porting of new interface repositories 2024-10-09 09:53:39 +00:00