aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Dto/DtoService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Dto/DtoService.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index 90ca64058..f6291cf36 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -129,17 +129,13 @@ namespace MediaBrowser.Server.Implementations.Dto
/// <param name="user">The user.</param>
private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
{
- ItemByNameCounts counts;
-
if (user == null)
{
//counts = item.ItemCounts;
return;
}
- if (!item.UserItemCounts.TryGetValue(user.Id, out counts))
- {
- counts = new ItemByNameCounts();
- }
+
+ ItemByNameCounts counts = item.GetItemByNameCounts(user.Id) ?? new ItemByNameCounts();
dto.ChildCount = counts.TotalCount;