diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-12 14:40:27 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-12 14:40:27 -0500 |
| commit | d84bb7160f8c3cfc953cdece890264d70e504e39 (patch) | |
| tree | fd325dc95a3dfb6acf817c035d15870530b0bc48 /Emby.Server.Implementations/Library | |
| parent | c2d0fd99852aae31379b89591b538d075743362f (diff) | |
update next up queries
Diffstat (limited to 'Emby.Server.Implementations/Library')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 3db8c7213..ad91988e5 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1279,6 +1279,26 @@ namespace Emby.Server.Implementations.Library return ItemRepository.GetItemList(query); } + public int GetCount(InternalItemsQuery query) + { + if (query.Recursive && query.ParentId.HasValue) + { + var parent = GetItemById(query.ParentId.Value); + if (parent != null) + { + SetTopParentIdsOrAncestors(query, new List<BaseItem> { parent }); + query.ParentId = null; + } + } + + if (query.User != null) + { + AddUserToQuery(query, query.User); + } + + return ItemRepository.GetCount(query); + } + public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, List<BaseItem> parents) { SetTopParentIdsOrAncestors(query, parents); |
