< Summary - Jellyfin

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.ComponentModel.DataAnnotations.Schema;
 5using Jellyfin.Data.Interfaces;
 6
 7namespace Jellyfin.Data.Entities.Libraries
 8{
 9    /// <summary>
 10    /// An entity representing a release for a library item, eg. Director's cut vs. standard.
 11    /// </summary>
 12    public class Release : IHasConcurrencyToken
 13    {
 14        /// <summary>
 15        /// Initializes a new instance of the <see cref="Release"/> class.
 16        /// </summary>
 17        /// <param name="name">The name of this release.</param>
 18        public Release(string name)
 19        {
 020            ArgumentException.ThrowIfNullOrEmpty(name);
 21
 022            Name = name;
 23
 024            MediaFiles = new HashSet<MediaFile>();
 025            Chapters = new HashSet<Chapter>();
 026        }
 27
 28        /// <summary>
 29        /// Gets the id.
 30        /// </summary>
 31        /// <remarks>
 32        /// Identity, Indexed, Required.
 33        /// </remarks>
 34        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 35        public int Id { get; private set; }
 36
 37        /// <summary>
 38        /// Gets or sets the name.
 39        /// </summary>
 40        /// <remarks>
 41        /// Required, Max length = 1024.
 42        /// </remarks>
 43        [MaxLength(1024)]
 44        [StringLength(1024)]
 45        public string Name { get; set; }
 46
 47        /// <inheritdoc />
 48        [ConcurrencyCheck]
 49        public uint RowVersion { get; private set; }
 50
 51        /// <summary>
 52        /// Gets a collection containing the media files for this release.
 53        /// </summary>
 54        public virtual ICollection<MediaFile> MediaFiles { get; private set; }
 55
 56        /// <summary>
 57        /// Gets a collection containing the chapters for this release.
 58        /// </summary>
 59        public virtual ICollection<Chapter> Chapters { get; private set; }
 60
 61        /// <inheritdoc />
 62        public void OnSavingChanges()
 63        {
 064            RowVersion++;
 065        }
 66    }
 67}