diff options
| author | Cody Robibero <cody@robibe.ro> | 2026-08-07 21:43:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-07 21:43:21 -0400 |
| commit | 247ee406a986933d6b006a55605bb1881588f35d (patch) | |
| tree | 07203c8d1af51845fb830b53ed9ce6f86fae1a99 /MediaBrowser.Controller | |
| parent | 2218f2931c5ae2f2c7c676d321c9d6803f066782 (diff) | |
| parent | d6da6906a4b3426f05c5bf4ffe8bab4b2bc78ce8 (diff) | |
Merge pull request #17571 from obiwantoby/perf/batch-people-dto
Batch people lookups when building item DTOs
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Library/ILibraryManager.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Persistence/IPeopleRepository.cs | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 6d85a1e401..5eae6e103f 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -606,6 +606,13 @@ namespace MediaBrowser.Controller.Library 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> /// <param name="query">The query.</param> diff --git a/MediaBrowser.Controller/Persistence/IPeopleRepository.cs b/MediaBrowser.Controller/Persistence/IPeopleRepository.cs index e2833dc722..9811241d31 100644 --- a/MediaBrowser.Controller/Persistence/IPeopleRepository.cs +++ b/MediaBrowser.Controller/Persistence/IPeopleRepository.cs @@ -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); } |
