< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.RatingSource
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/RatingSource.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 73
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/RatingSource.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    /// This is the entity to store review ratings, not age ratings.
 9    /// </summary>
 10    public class RatingSource : IHasConcurrencyToken
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="RatingSource"/> class.
 14        /// </summary>
 15        /// <param name="minimumValue">The minimum value.</param>
 16        /// <param name="maximumValue">The maximum value.</param>
 17        public RatingSource(double minimumValue, double maximumValue)
 18        {
 019            MinimumValue = minimumValue;
 020            MaximumValue = maximumValue;
 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        /// Max length = 1024.
 37        /// </remarks>
 38        [MaxLength(1024)]
 39        [StringLength(1024)]
 40        public string? Name { get; set; }
 41
 42        /// <summary>
 43        /// Gets or sets the minimum value.
 44        /// </summary>
 45        /// <remarks>
 46        /// Required.
 47        /// </remarks>
 48        public double MinimumValue { get; set; }
 49
 50        /// <summary>
 51        /// Gets or sets the maximum value.
 52        /// </summary>
 53        /// <remarks>
 54        /// Required.
 55        /// </remarks>
 56        public double MaximumValue { get; set; }
 57
 58        /// <inheritdoc />
 59        [ConcurrencyCheck]
 60        public uint RowVersion { get; private set; }
 61
 62        /// <summary>
 63        /// Gets or sets the metadata source.
 64        /// </summary>
 65        public virtual MetadataProviderId? Source { get; set; }
 66
 67        /// <inheritdoc />
 68        public void OnSavingChanges()
 69        {
 070            RowVersion++;
 071        }
 72    }
 73}