IHasAlbumArtist.cs 769 B

12345678910111213141516171819202122232425262728293031
  1. #pragma warning disable CS1591
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MediaBrowser.Controller.Library;
  5. namespace MediaBrowser.Controller.Entities.Audio
  6. {
  7. public interface IHasAlbumArtist
  8. {
  9. IReadOnlyList<string> AlbumArtists { get; set; }
  10. }
  11. public interface IHasArtist
  12. {
  13. /// <summary>
  14. /// Gets or sets the artists.
  15. /// </summary>
  16. /// <value>The artists.</value>
  17. IReadOnlyList<string> Artists { get; set; }
  18. }
  19. public static class Extentions
  20. {
  21. public static IEnumerable<string> GetAllArtists<T>(this T item)
  22. where T : IHasArtist, IHasAlbumArtist
  23. {
  24. return item.AlbumArtists.Concat(item.Artists).DistinctNames();
  25. }
  26. }
  27. }