2019-08-29 13:28:33 -07:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
|
|
{
|
|
|
|
public interface IHasAlbumArtist
|
|
|
|
{
|
2019-08-29 13:28:33 -07:00
|
|
|
IReadOnlyList<string> AlbumArtists { get; set; }
|
2018-12-27 16:27:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public interface IHasArtist
|
|
|
|
{
|
2019-08-29 13:28:33 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the artists.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The artists.</value>
|
|
|
|
IReadOnlyList<string> Artists { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class Extentions
|
|
|
|
{
|
|
|
|
public static IEnumerable<string> GetAllArtists<T>(this T item)
|
|
|
|
where T : IHasArtist, IHasAlbumArtist
|
|
|
|
{
|
|
|
|
foreach (var i in item.AlbumArtists)
|
|
|
|
{
|
|
|
|
yield return i;
|
|
|
|
}
|
2018-12-27 16:27:57 -07:00
|
|
|
|
2019-08-29 13:28:33 -07:00
|
|
|
foreach (var i in item.Artists)
|
|
|
|
{
|
|
|
|
yield return i;
|
|
|
|
}
|
|
|
|
}
|
2018-12-27 16:27:57 -07:00
|
|
|
}
|
|
|
|
}
|