#pragma warning disable CA2227
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Data.Enums;
using Jellyfin.Data.Interfaces;
namespace Jellyfin.Data.Entities.Libraries
{
///
/// An entity representing artwork.
///
public class Artwork : IHasConcurrencyToken
{
///
/// Initializes a new instance of the class.
///
/// The path.
/// The kind of art.
public Artwork(string path, ArtKind kind)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException(nameof(path));
}
Path = path;
Kind = kind;
}
///
/// Gets or sets the id.
///
///
/// Identity, Indexed, Required.
///
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; protected set; }
///
/// Gets or sets the path.
///
///
/// Required, Max length = 65535.
///
[MaxLength(65535)]
[StringLength(65535)]
public string Path { get; set; }
///
/// Gets or sets the kind of artwork.
///
///
/// Required.
///
public ArtKind Kind { get; set; }
///
[ConcurrencyCheck]
public uint RowVersion { get; set; }
///
public void OnSavingChanges()
{
RowVersion++;
}
}
}