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