diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-12 14:40:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-12 14:40:54 -0500 |
| commit | acf71527b52bea3d986d5bb3a899b4d8d5c6e2ac (patch) | |
| tree | e6b39da5709b9b2fad03370c69181137f3141d0f /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | 73e7f20823ed0d18f90c5848791422e83d603f5c (diff) | |
| parent | d84bb7160f8c3cfc953cdece890264d70e504e39 (diff) | |
Merge pull request #2339 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -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); |
