< Summary - Jellyfin

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

#LineLine coverage
 1using System;
 2using System.ComponentModel.DataAnnotations;
 3using System.ComponentModel.DataAnnotations.Schema;
 4using Jellyfin.Data.Interfaces;
 5
 6namespace Jellyfin.Data.Entities.Libraries
 7{
 8    /// <summary>
 9    /// An entity representing a library item.
 10    /// </summary>
 11    public abstract class LibraryItem : IHasConcurrencyToken
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="LibraryItem"/> class.
 15        /// </summary>
 16        /// <param name="library">The library of this item.</param>
 17        protected LibraryItem(Library library)
 18        {
 019            DateAdded = DateTime.UtcNow;
 020            Library = library;
 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 the date this library item was added.
 34        /// </summary>
 35        public DateTime DateAdded { get; private set; }
 36
 37        /// <inheritdoc />
 38        [ConcurrencyCheck]
 39        public uint RowVersion { get; private set; }
 40
 41        /// <summary>
 42        /// Gets or sets the library of this item.
 43        /// </summary>
 44        /// <remarks>
 45        /// Required.
 46        /// </remarks>
 47        public virtual Library Library { get; set; }
 48
 49        /// <inheritdoc />
 50        public void OnSavingChanges()
 51        {
 052            RowVersion++;
 053        }
 54    }
 55}