< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Entities.Audio.Extentions
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 33
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetAllArtists(...)100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs

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

Methods/Properties

GetAllArtists(T)