IHasAlbumArtist.cs 790 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace MediaBrowser.Controller.Entities.Audio
  5. {
  6. public interface IHasAlbumArtist
  7. {
  8. List<string> AlbumArtists { get; set; }
  9. }
  10. public interface IHasArtist
  11. {
  12. List<string> AllArtists { get; }
  13. List<string> Artists { get; set; }
  14. }
  15. public static class HasArtistExtensions
  16. {
  17. public static bool HasArtist(this IHasArtist hasArtist, string artist)
  18. {
  19. return hasArtist.Artists.Contains(artist, StringComparer.OrdinalIgnoreCase);
  20. }
  21. public static bool HasAnyArtist(this IHasArtist hasArtist, string artist)
  22. {
  23. return hasArtist.AllArtists.Contains(artist, StringComparer.OrdinalIgnoreCase);
  24. }
  25. }
  26. }