< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.CollectionItem
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/CollectionItem.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 64
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/CollectionItem.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 collection item.
 9    /// </summary>
 10    public class CollectionItem : IHasConcurrencyToken
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="CollectionItem"/> class.
 14        /// </summary>
 15        /// <param name="libraryItem">The library item.</param>
 16        public CollectionItem(LibraryItem libraryItem)
 17        {
 018            LibraryItem = libraryItem;
 019        }
 20
 21        /// <summary>
 22        /// Gets or sets the id.
 23        /// </summary>
 24        /// <remarks>
 25        /// Identity, Indexed, Required.
 26        /// </remarks>
 27        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 28        public int Id { get; set; }
 29
 30        /// <inheritdoc />
 31        [ConcurrencyCheck]
 32        public uint RowVersion { get; private set; }
 33
 34        /// <summary>
 35        /// Gets or sets the library item.
 36        /// </summary>
 37        /// <remarks>
 38        /// Required.
 39        /// </remarks>
 40        public virtual LibraryItem LibraryItem { get; set; }
 41
 42        /// <summary>
 43        /// Gets or sets the next item in the collection.
 44        /// </summary>
 45        /// <remarks>
 46        /// TODO check if this properly updated Dependant and has the proper principal relationship.
 47        /// </remarks>
 48        public virtual CollectionItem? Next { get; set; }
 49
 50        /// <summary>
 51        /// Gets or sets the previous item in the collection.
 52        /// </summary>
 53        /// <remarks>
 54        /// TODO check if this properly updated Dependant and has the proper principal relationship.
 55        /// </remarks>
 56        public virtual CollectionItem? Previous { get; set; }
 57
 58        /// <inheritdoc />
 59        public void OnSavingChanges()
 60        {
 061            RowVersion++;
 062        }
 63    }
 64}