< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.Library
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Library.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 60
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
.ctor(...)100%210%
OnSavingChanges()100%210%

File(s)

/srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Library.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2using System.ComponentModel.DataAnnotations.Schema;
 3using Jellyfin.Data.Interfaces;
 4
 5namespace Jellyfin.Data.Entities.Libraries
 6{
 7    /// <summary>
 8    /// An entity representing a library.
 9    /// </summary>
 10    public class Library : IHasConcurrencyToken
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="Library"/> class.
 14        /// </summary>
 15        /// <param name="name">The name of the library.</param>
 16        /// <param name="path">The path of the library.</param>
 17        public Library(string name, string path)
 18        {
 019            Name = name;
 020            Path = path;
 021        }
 22
 23        /// <summary>
 24        /// Gets the id.
 25        /// </summary>
 26        /// <remarks>
 27        /// Identity, Indexed, Required.
 28        /// </remarks>
 29        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 30        public int Id { get; private set; }
 31
 32        /// <summary>
 33        /// Gets or sets the name.
 34        /// </summary>
 35        /// <remarks>
 36        /// Required, Max length = 128.
 37        /// </remarks>
 38        [MaxLength(128)]
 39        [StringLength(128)]
 40        public string Name { get; set; }
 41
 42        /// <summary>
 43        /// Gets or sets the root path of the library.
 44        /// </summary>
 45        /// <remarks>
 46        /// Required.
 47        /// </remarks>
 48        public string Path { get; set; }
 49
 50        /// <inheritdoc />
 51        [ConcurrencyCheck]
 52        public uint RowVersion { get; private set; }
 53
 54        /// <inheritdoc />
 55        public void OnSavingChanges()
 56        {
 057            RowVersion++;
 058        }
 59    }
 60}