< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.Chapter
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/Chapter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 80
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/Chapter.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 chapter.
 10    /// </summary>
 11    public class Chapter : IHasConcurrencyToken
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="Chapter"/> class.
 15        /// </summary>
 16        /// <param name="language">ISO-639-3 3-character language codes.</param>
 17        /// <param name="startTime">The start time for this chapter.</param>
 18        public Chapter(string language, long startTime)
 19        {
 020            ArgumentException.ThrowIfNullOrEmpty(language);
 21
 022            Language = language;
 023            StartTime = startTime;
 024        }
 25
 26        /// <summary>
 27        /// Gets the id.
 28        /// </summary>
 29        /// <remarks>
 30        /// Identity, Indexed, Required.
 31        /// </remarks>
 32        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 33        public int Id { get; private set; }
 34
 35        /// <summary>
 36        /// Gets or sets the name.
 37        /// </summary>
 38        /// <remarks>
 39        /// Max length = 1024.
 40        /// </remarks>
 41        [MaxLength(1024)]
 42        [StringLength(1024)]
 43        public string? Name { get; set; }
 44
 45        /// <summary>
 46        /// Gets or sets the language.
 47        /// </summary>
 48        /// <remarks>
 49        /// Required, Min length = 3, Max length = 3
 50        /// ISO-639-3 3-character language codes.
 51        /// </remarks>
 52        [MinLength(3)]
 53        [MaxLength(3)]
 54        [StringLength(3)]
 55        public string Language { get; set; }
 56
 57        /// <summary>
 58        /// Gets or sets the start time.
 59        /// </summary>
 60        /// <remarks>
 61        /// Required.
 62        /// </remarks>
 63        public long StartTime { get; set; }
 64
 65        /// <summary>
 66        /// Gets or sets the end time.
 67        /// </summary>
 68        public long? EndTime { get; set; }
 69
 70        /// <inheritdoc />
 71        [ConcurrencyCheck]
 72        public uint RowVersion { get; private set; }
 73
 74        /// <inheritdoc />
 75        public void OnSavingChanges()
 76        {
 077            RowVersion++;
 078        }
 79    }
 80}