< Summary - Jellyfin

Information
Class: Jellyfin.Data.Entities.Libraries.MetadataProvider
Assembly: Jellyfin.Data
File(s): /srv/git/jellyfin/Jellyfin.Data/Entities/Libraries/MetadataProvider.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 53
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/MetadataProvider.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 metadata provider.
 10    /// </summary>
 11    public class MetadataProvider : IHasConcurrencyToken
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="MetadataProvider"/> class.
 15        /// </summary>
 16        /// <param name="name">The name of the metadata provider.</param>
 17        public MetadataProvider(string name)
 18        {
 019            ArgumentException.ThrowIfNullOrEmpty(name);
 20
 021            Name = name;
 022        }
 23
 24        /// <summary>
 25        /// Gets the id.
 26        /// </summary>
 27        /// <remarks>
 28        /// Identity, Indexed, Required.
 29        /// </remarks>
 30        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 31        public int Id { get; private set; }
 32
 33        /// <summary>
 34        /// Gets or sets the name.
 35        /// </summary>
 36        /// <remarks>
 37        /// Required, Max length = 1024.
 38        /// </remarks>
 39        [MaxLength(1024)]
 40        [StringLength(1024)]
 41        public string Name { get; set; }
 42
 43        /// <inheritdoc />
 44        [ConcurrencyCheck]
 45        public uint RowVersion { get; private set; }
 46
 47        /// <inheritdoc />
 48        public void OnSavingChanges()
 49        {
 050            RowVersion++;
 051        }
 52    }
 53}