From bb6bf0f8a0c58ea0f4560c8c78a46079b471c735 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 21 May 2016 19:13:35 -0400 Subject: [PATCH] fix suggestions prioritizing trailers over movies --- MediaBrowser.Api/Movies/MoviesService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/Movies/MoviesService.cs b/MediaBrowser.Api/Movies/MoviesService.cs index 786615cc3..d8946e416 100644 --- a/MediaBrowser.Api/Movies/MoviesService.cs +++ b/MediaBrowser.Api/Movies/MoviesService.cs @@ -143,7 +143,8 @@ namespace MediaBrowser.Api.Movies } var parentIds = string.IsNullOrWhiteSpace(request.ParentId) ? new string[] { } : new[] { request.ParentId }; - var movies = _libraryManager.GetItemList(query, parentIds); + var movies = _libraryManager.GetItemList(query, parentIds) + .OrderBy(i => (int)i.SourceType); var listEligibleForCategories = new List(); var listEligibleForSuggestion = new List(); @@ -194,8 +195,8 @@ namespace MediaBrowser.Api.Movies query.IncludeItemTypes = includeList.ToArray(); } - var parentIds = new string[] { }; - var list = _libraryManager.GetItemList(query, parentIds) + var list = _libraryManager.GetItemList(query) + .OrderBy(i => (int)i.SourceType) .DistinctBy(i => i.GetProviderId(MetadataProviders.Imdb) ?? Guid.NewGuid().ToString("N")) .ToList();