< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Entities.LinkedChild
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Entities/LinkedChild.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 45
Line coverage: 0%
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

0255075100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
Create(...)0%620%

File(s)

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

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CS1591
 4
 5using System;
 6using System.Globalization;
 7
 8namespace MediaBrowser.Controller.Entities
 9{
 10    public class LinkedChild
 11    {
 12        public LinkedChild()
 13        {
 014        }
 15
 16        public string Path { get; set; }
 17
 18        public LinkedChildType Type { get; set; }
 19
 20        public string LibraryItemId { get; set; }
 21
 22        /// <summary>
 23        /// Gets or sets the linked item id.
 24        /// </summary>
 25        public Guid? ItemId { get; set; }
 26
 27        public static LinkedChild Create(BaseItem item)
 28        {
 029            ArgumentNullException.ThrowIfNull(item);
 30
 031            var child = new LinkedChild
 032            {
 033                Path = item.Path,
 034                Type = LinkedChildType.Manual
 035            };
 36
 037            if (string.IsNullOrEmpty(child.Path))
 38            {
 039                child.LibraryItemId = item.Id.ToString("N", CultureInfo.InvariantCulture);
 40            }
 41
 042            return child;
 43        }
 44    }
 45}