jellyfin-server/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs

31 lines
790 B
C#
Raw Normal View History

2015-03-13 17:25:28 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Controller.Entities.Audio
{
public interface IHasAlbumArtist
{
2014-06-23 16:05:19 +00:00
List<string> AlbumArtists { get; set; }
}
public interface IHasArtist
{
List<string> AllArtists { get; }
2014-09-05 03:48:53 +00:00
2015-03-13 17:25:28 +00:00
List<string> Artists { get; set; }
}
public static class HasArtistExtensions
{
public static bool HasArtist(this IHasArtist hasArtist, string artist)
{
return hasArtist.Artists.Contains(artist, StringComparer.OrdinalIgnoreCase);
}
public static bool HasAnyArtist(this IHasArtist hasArtist, string artist)
{
return hasArtist.AllArtists.Contains(artist, StringComparer.OrdinalIgnoreCase);
}
}
}