Merge pull request #17571 from obiwantoby/perf/batch-people-dto

Batch people lookups when building item DTOs
This commit is contained in:
Cody Robibero
2026-08-07 21:43:21 -04:00
committed by GitHub
6 changed files with 149 additions and 5 deletions
@@ -605,6 +605,13 @@ namespace MediaBrowser.Controller.Library
/// <returns>A dictionary mapping each item ID to its distinct people names. Items with no matching people are omitted.</returns>
IReadOnlyDictionary<Guid, IReadOnlyList<string>> GetPeopleNamesByItems(IReadOnlyList<Guid> itemIds, IReadOnlyList<string> personTypes);
/// <summary>
/// Gets the people for multiple items in a single query, keyed by item id.
/// </summary>
/// <param name="itemIds">The item IDs.</param>
/// <returns>A dictionary mapping each item ID to its people. Items with no people are omitted.</returns>
IReadOnlyDictionary<Guid, IReadOnlyList<PersonInfo>> GetPeopleByItems(IReadOnlyList<Guid> itemIds);
/// <summary>
/// Queries the items.
/// </summary>
@@ -40,4 +40,11 @@ public interface IPeopleRepository
/// <param name="personTypes">The person types to include (e.g. "Actor", "Director").</param>
/// <returns>A dictionary mapping each item ID to its distinct people names, ordered by cast list order. Items with no matching people are omitted.</returns>
IReadOnlyDictionary<Guid, IReadOnlyList<string>> GetPeopleNamesByItems(IReadOnlyList<Guid> itemIds, IReadOnlyList<string> personTypes);
/// <summary>
/// Gets the people for multiple items in a single query, keyed by item id.
/// </summary>
/// <param name="itemIds">The item IDs to get people for.</param>
/// <returns>A dictionary mapping each item ID to its people (with role, type and sort order), ordered by cast list order. Items with no people are omitted.</returns>
IReadOnlyDictionary<Guid, IReadOnlyList<PersonInfo>> GetPeopleByItems(IReadOnlyList<Guid> itemIds);
}