2021-05-06 18:39:20 -04:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 15:56:24 -04:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-08-29 16:28:33 -04:00
|
|
|
using System.Collections.Generic;
|
2021-03-10 02:20:02 -05:00
|
|
|
using System.Linq;
|
|
|
|
using MediaBrowser.Controller.Library;
|
2019-08-29 16:28:33 -04:00
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
|
|
{
|
|
|
|
public interface IHasAlbumArtist
|
|
|
|
{
|
2019-08-29 16:28:33 -04:00
|
|
|
IReadOnlyList<string> AlbumArtists { get; set; }
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public interface IHasArtist
|
|
|
|
{
|
2019-08-29 16:28:33 -04: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
|
|
|
|
{
|
2021-03-10 02:20:02 -05:00
|
|
|
return item.AlbumArtists.Concat(item.Artists).DistinctNames();
|
2019-08-29 16:28:33 -04:00
|
|
|
}
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
}
|