IHasAlbumArtist.cs 788 B

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