From ba336372512e6366517a67e8b12677333266d032 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jun 2014 21:38:37 -0400 Subject: [PATCH] fixes #772 - "Suggested" duplicates --- MediaBrowser.Api/Movies/MoviesService.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Api/Movies/MoviesService.cs b/MediaBrowser.Api/Movies/MoviesService.cs index 2851428009..db02ed4280 100644 --- a/MediaBrowser.Api/Movies/MoviesService.cs +++ b/MediaBrowser.Api/Movies/MoviesService.cs @@ -125,10 +125,11 @@ namespace MediaBrowser.Api.Movies var user = _userManager.GetUserById(request.UserId.Value); var movies = GetAllLibraryItems(request.UserId, _userManager, _libraryManager, request.ParentId) - .OfType() - .ToList(); + .OfType(); + + movies = _libraryManager.ReplaceVideosWithPrimaryVersions(movies).Cast(); - var result = GetRecommendationCategories(user, movies, request.CategoryLimit, request.ItemLimit, request.GetItemFields().ToList()); + var result = GetRecommendationCategories(user, movies.ToList(), request.CategoryLimit, request.ItemLimit, request.GetItemFields().ToList()); return ToOptimizedResult(result); } @@ -227,15 +228,6 @@ namespace MediaBrowser.Api.Movies } } - //// Get the lead actor for all movies - //var allActors = GetActors(allMovies) - // .ToList(); - - //foreach (var actor in recentActors) - //{ - - //} - return categories.OrderBy(i => i.RecommendationType).ThenBy(i => Guid.NewGuid()); }