From 3a090a571682033f54cc2824d4003ff873467b4c Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 18 Feb 2026 20:28:42 +0100 Subject: Optimize item count calculation for named items --- Emby.Server.Implementations/Library/LibraryManager.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs') diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 9a5bd41914..60ac15ca97 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1561,6 +1561,18 @@ namespace Emby.Server.Implementations.Library return _itemRepository.GetItemCounts(query); } + /// + public ItemCounts GetItemCountsForNameItem(BaseItemKind kind, Guid id, BaseItemKind[] relatedItemKinds, User? user) + { + var query = new InternalItemsQuery(user); + if (user is not null) + { + AddUserToQuery(query, user); + } + + return _itemRepository.GetItemCountsForNameItem(kind, id, relatedItemKinds, query); + } + public Dictionary GetChildCountBatch(IReadOnlyList parentIds, Guid? userId) { return _itemRepository.GetChildCountBatch(parentIds, userId); -- cgit v1.2.3