aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Library')
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index 9b46dec3fe..3b3295c57d 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -698,6 +698,15 @@ namespace MediaBrowser.Controller.Library
Dictionary<Guid, int> GetChildCountBatch(IReadOnlyList<Guid> parentIds, Guid? userId);
/// <summary>
+ /// Batch-fetches played and total counts for multiple folder items.
+ /// Avoids N+1 queries when building DTOs for lists of folder items.
+ /// </summary>
+ /// <param name="folderIds">The list of folder item IDs.</param>
+ /// <param name="user">The user for access filtering and played status.</param>
+ /// <returns>Dictionary mapping folder ID to (Played count, Total count).</returns>
+ Dictionary<Guid, (int Played, int Total)> GetPlayedAndTotalCountBatch(IReadOnlyList<Guid> folderIds, User user);
+
+ /// <summary>
/// Configures the query with user access settings including TopParentIds for library access.
/// Call this before passing a query to methods that need user access filtering.
/// </summary>