fixes #508 - Add more sort orders to web client album page

This commit is contained in:
Luke Pulverenti 2013-09-03 10:33:40 -04:00
parent 35f755cce3
commit 2e43a0746c

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
using System.Linq;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
@ -31,7 +32,26 @@ namespace MediaBrowser.Server.Implementations.Sorting
{
var audio = x as Audio;
return audio == null ? string.Empty : audio.AlbumArtist;
if (audio != null)
{
return audio.AlbumArtist;
}
var album = x as MusicAlbum;
if (album != null)
{
var song = album.RecursiveChildren
.OfType<Audio>()
.FirstOrDefault(i => !string.IsNullOrEmpty(i.AlbumArtist));
if (song != null)
{
return song.AlbumArtist;
}
}
return null;
}
/// <summary>