fix suggestions prioritizing trailers over movies

This commit is contained in:
Luke Pulverenti 2016-05-21 19:13:35 -04:00
parent 0963717643
commit bb6bf0f8a0

View File

@ -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<BaseItem>();
var listEligibleForSuggestion = new List<BaseItem>();
@ -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();