IHasAlbumArtist.cs 818 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. namespace MediaBrowser.Controller.Entities.Audio
  3. {
  4. public interface IHasAlbumArtist
  5. {
  6. IReadOnlyList<string> AlbumArtists { get; set; }
  7. }
  8. public interface IHasArtist
  9. {
  10. /// <summary>
  11. /// Gets or sets the artists.
  12. /// </summary>
  13. /// <value>The artists.</value>
  14. IReadOnlyList<string> Artists { get; set; }
  15. }
  16. public static class Extentions
  17. {
  18. public static IEnumerable<string> GetAllArtists<T>(this T item)
  19. where T : IHasArtist, IHasAlbumArtist
  20. {
  21. foreach (var i in item.AlbumArtists)
  22. {
  23. yield return i;
  24. }
  25. foreach (var i in item.Artists)
  26. {
  27. yield return i;
  28. }
  29. }
  30. }
  31. }