< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Entities.PersonInfo
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Entities/PersonInfo.cs
Line coverage
50%
Covered lines: 2
Uncovered lines: 2
Coverable lines: 4
Total lines: 63
Line coverage: 50%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
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
.ctor()100%11100%
ToString()100%210%
IsType(...)0%620%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/Entities/PersonInfo.cs

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CA2227, CS1591
 4
 5using System;
 6using System.Collections.Generic;
 7using Jellyfin.Data.Enums;
 8using MediaBrowser.Model.Entities;
 9
 10namespace MediaBrowser.Controller.Entities
 11{
 12    /// <summary>
 13    /// This is a small Person stub that is attached to BaseItems.
 14    /// </summary>
 15    public sealed class PersonInfo : IHasProviderIds
 16    {
 17        public PersonInfo()
 18        {
 7319            ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
 7320        }
 21
 22        public Guid ItemId { get; set; }
 23
 24        /// <summary>
 25        /// Gets or sets the name.
 26        /// </summary>
 27        /// <value>The name.</value>
 28        public string Name { get; set; }
 29
 30        /// <summary>
 31        /// Gets or sets the role.
 32        /// </summary>
 33        /// <value>The role.</value>
 34        public string Role { get; set; }
 35
 36        /// <summary>
 37        /// Gets or sets the type.
 38        /// </summary>
 39        /// <value>The type.</value>
 40        public PersonKind Type { get; set; }
 41
 42        /// <summary>
 43        /// Gets or sets the ascending sort order.
 44        /// </summary>
 45        /// <value>The sort order.</value>
 46        public int? SortOrder { get; set; }
 47
 48        public string ImageUrl { get; set; }
 49
 50        public Dictionary<string, string> ProviderIds { get; set; }
 51
 52        /// <summary>
 53        /// Returns a <see cref="string" /> that represents this instance.
 54        /// </summary>
 55        /// <returns>A <see cref="string" /> that represents this instance.</returns>
 56        public override string ToString()
 57        {
 058            return Name;
 59        }
 60
 061        public bool IsType(PersonKind type) => Type == type || string.Equals(type.ToString(), Role, StringComparison.Ord
 62    }
 63}