From 94568868488ba479cebb20050dd16b41378a7878 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 20 Oct 2013 23:01:22 -0400 Subject: [PATCH] updated nuget --- .../DefaultTheme/DefaultThemeService.cs | 50 ++++++-- MediaBrowser.Api/LibraryService.cs | 120 +++++++++--------- .../UserLibrary/BaseItemsByNameService.cs | 2 +- .../MediaBrowser.Model.Portable.csproj | 3 + .../MediaBrowser.Model.net35.csproj | 3 + MediaBrowser.Model/ApiClient/IApiClient.cs | 4 +- MediaBrowser.Model/Dto/ItemCounts.cs | 54 +------- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 + .../Querying/ItemCountsQuery.cs | 21 +++ Nuget/MediaBrowser.Common.Internal.nuspec | 4 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- 12 files changed, 142 insertions(+), 126 deletions(-) create mode 100644 MediaBrowser.Model/Querying/ItemCountsQuery.cs diff --git a/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs b/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs index 385bef026..77f4f3dba 100644 --- a/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs +++ b/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs @@ -82,13 +82,16 @@ namespace MediaBrowser.Api.DefaultTheme { var user = _userManager.GetUserById(request.UserId); - var allItems = user.RootFolder.GetRecursiveChildren(user, i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite) + var allItems = user.RootFolder.GetRecursiveChildren(user) .ToList(); - var itemsWithImages = allItems.Where(i => !string.IsNullOrEmpty(i.PrimaryImagePath)) + var allFavoriteItems = allItems.Where(i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite) .ToList(); - var itemsWithBackdrops = allItems.Where(i => i.BackdropImagePaths.Count > 0) + var itemsWithImages = allFavoriteItems.Where(i => !string.IsNullOrEmpty(i.PrimaryImagePath)) + .ToList(); + + var itemsWithBackdrops = allFavoriteItems.Where(i => i.BackdropImagePaths.Count > 0) .ToList(); var view = new FavoritesView(); @@ -157,13 +160,6 @@ namespace MediaBrowser.Api.DefaultTheme .Select(i => _dtoService.GetBaseItemDto(i, fields, user)) .ToList(); - view.Artists = itemsWithImages - .OfType() - .OrderBy(i => Guid.NewGuid()) - .Take(4) - .Select(i => _dtoService.GetBaseItemDto(i, fields, user)) - .ToList(); - view.MiniSpotlights = itemsWithBackdrops .Except(spotlightItems) .OrderBy(i => Guid.NewGuid()) @@ -171,6 +167,40 @@ namespace MediaBrowser.Api.DefaultTheme .Select(i => _dtoService.GetBaseItemDto(i, fields, user)) .ToList(); + var artists = allItems.OfType