using System;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Users;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.Entities.Audio
{
///
/// Class MusicAlbum
///
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo, IMetadataContainer
{
public MusicAlbum()
{
Artists = new List();
AlbumArtists = new List();
}
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{
get { return true; }
}
[IgnoreDataMember]
public MusicArtist MusicArtist
{
get
{
var artist = GetParents().OfType().FirstOrDefault();
if (artist == null)
{
var name = AlbumArtist;
if (!string.IsNullOrWhiteSpace(name))
{
artist = LibraryManager.GetArtist(name);
}
}
return artist;
}
}
[IgnoreDataMember]
public List AllArtists
{
get
{
var list = AlbumArtists.ToList();
list.AddRange(Artists);
return list;
}
}
[IgnoreDataMember]
public string AlbumArtist
{
get { return AlbumArtists.FirstOrDefault(); }
}
[IgnoreDataMember]
public override bool SupportsPeople
{
get { return false; }
}
public List AlbumArtists { get; set; }
///
/// Gets the tracks.
///
/// The tracks.
[IgnoreDataMember]
public IEnumerable