improved instant mix algorithm

pull/702/head
Luke Pulverenti 11 years ago
parent 2173ab0f9f
commit 9f0405b9a0

@ -66,9 +66,16 @@ namespace MediaBrowser.Api
public object Get(GetInstantMixFromAlbum request)
{
var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager);
var album = (MusicAlbum)DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager);
var result = GetInstantMixResult(request, item.Genres).Result;
var genres = album
.RecursiveChildren
.OfType<Audio>()
.SelectMany(i => i.Genres)
.Concat(album.Genres)
.Distinct(StringComparer.OrdinalIgnoreCase);
var result = GetInstantMixResult(request, genres).Result;
return ToOptimizedResult(result);
}
@ -91,6 +98,7 @@ namespace MediaBrowser.Api
.OfType<Audio>()
.Where(i => i.HasArtist(artist.Name))
.SelectMany(i => i.Genres)
.Concat(artist.Genres)
.Distinct(StringComparer.OrdinalIgnoreCase);
var result = GetInstantMixResult(request, genres).Result;

Loading…
Cancel
Save