aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs
blob: f6d3cd6cc251595f727742796d90b1606e9c7b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma warning disable CS1591

using System.Collections.Generic;

namespace MediaBrowser.Controller.Entities.Audio
{
    public interface IHasAlbumArtist
    {
        IReadOnlyList<string> AlbumArtists { get; set; }
    }

    public interface IHasArtist
    {
        /// <summary>
        /// Gets or sets the artists.
        /// </summary>
        /// <value>The artists.</value>
        IReadOnlyList<string> Artists { get; set; }
    }

    public static class Extentions
    {
        public static IEnumerable<string> GetAllArtists<T>(this T item)
            where T : IHasArtist, IHasAlbumArtist
        {
            foreach (var i in item.AlbumArtists)
            {
                yield return i;
            }

            foreach (var i in item.Artists)
            {
                yield return i;
            }
        }
    }
}