< Summary - Jellyfin

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

#LineLine coverage
 1using System;
 2using System.ComponentModel.DataAnnotations;
 3using System.ComponentModel.DataAnnotations.Schema;
 4using Jellyfin.Data.Enums;
 5using Jellyfin.Data.Interfaces;
 6
 7namespace Jellyfin.Data.Entities.Libraries
 8{
 9    /// <summary>
 10    /// An entity representing artwork.
 11    /// </summary>
 12    public class Artwork : IHasConcurrencyToken
 13    {
 14        /// <summary>
 15        /// Initializes a new instance of the <see cref="Artwork"/> class.
 16        /// </summary>
 17        /// <param name="path">The path.</param>
 18        /// <param name="kind">The kind of art.</param>
 19        public Artwork(string path, ArtKind kind)
 20        {
 021            ArgumentException.ThrowIfNullOrEmpty(path);
 22
 023            Path = path;
 024            Kind = kind;
 025        }
 26
 27        /// <summary>
 28        /// Gets the id.
 29        /// </summary>
 30        /// <remarks>
 31        /// Identity, Indexed, Required.
 32        /// </remarks>
 33        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 34        public int Id { get; private set; }
 35
 36        /// <summary>
 37        /// Gets or sets the path.
 38        /// </summary>
 39        /// <remarks>
 40        /// Required, Max length = 65535.
 41        /// </remarks>
 42        [MaxLength(65535)]
 43        [StringLength(65535)]
 44        public string Path { get; set; }
 45
 46        /// <summary>
 47        /// Gets or sets the kind of artwork.
 48        /// </summary>
 49        /// <remarks>
 50        /// Required.
 51        /// </remarks>
 52        public ArtKind Kind { get; set; }
 53
 54        /// <inheritdoc />
 55        [ConcurrencyCheck]
 56        public uint RowVersion { get; private set; }
 57
 58        /// <inheritdoc />
 59        public void OnSavingChanges()
 60        {
 061            RowVersion++;
 062        }
 63    }
 64}