< 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: 48
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

Coverage history 0 25 50 75 100

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;
 7using System.Text.Json.Serialization;
 8
 9namespace MediaBrowser.Controller.Entities
 10{
 11    public class LinkedChild
 12    {
 13        public LinkedChild()
 14        {
 015            Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
 016        }
 17
 18        public string Path { get; set; }
 19
 20        public LinkedChildType Type { get; set; }
 21
 22        public string LibraryItemId { get; set; }
 23
 24        [JsonIgnore]
 25        public string Id { get; set; }
 26
 27        /// <summary>
 28        /// Gets or sets the linked item id.
 29        /// </summary>
 30        public Guid? ItemId { get; set; }
 31
 32        public static LinkedChild Create(BaseItem item)
 33        {
 034            var child = new LinkedChild
 035            {
 036                Path = item.Path,
 037                Type = LinkedChildType.Manual
 038            };
 39
 040            if (string.IsNullOrEmpty(child.Path))
 41            {
 042                child.LibraryItemId = item.Id.ToString("N", CultureInfo.InvariantCulture);
 43            }
 44
 045            return child;
 46        }
 47    }
 48}