@ -1,399 +1,165 @@
#pragma warning disable CS1591
using System ;
using System.Collections.Generic ;
using System.ComponentModel.DataAnnotations ;
using System.ComponentModel.DataAnnotations.Schema ;
using Jellyfin.Data.Interfaces ;
namespace Jellyfin.Data.Entities.Libraries
{
public abstract partial class Metadata
/// <summary>
/// An abstract class that holds metadata.
/// </summary>
public abstract class Metadata : IHasArtwork , IHasConcurrencyToken
{
partial void Init ( ) ;
/// <summary>
/// Default constructor. Protected due to being abstract.
/// </summary>
protected Metadata ( )
{
PersonRoles = new HashSet < PersonRole > ( ) ;
Genres = new HashSet < Genre > ( ) ;
Artwork = new HashSet < Artwork > ( ) ;
Ratings = new HashSet < Rating > ( ) ;
Sources = new HashSet < MetadataProviderId > ( ) ;
Init ( ) ;
}
/// <summary>
/// Public constructor with required data .
/// Initializes a new instance of the <see cref="Metadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="dateadded">The date the object was added.</param>
/// <param name="datemodified">The date the object was last modified.</param>
protected Metadata ( string title , string language , DateTime dateadded , DateTime datemodified )
protected Metadata ( string title , string language )
{
if ( string . IsNullOrEmpty ( title ) )
{
throw new ArgumentNullException ( nameof ( title ) ) ;
}
this . Title = title ;
if ( string . IsNullOrEmpty ( language ) )
{
throw new ArgumentNullException ( nameof ( language ) ) ;
}
this . Language = language ;
this . PersonRoles = new HashSet < PersonRole > ( ) ;
this . Genres = new HashSet < Genre > ( ) ;
this . Artwork = new HashSet < Artwork > ( ) ;
this . Ratings = new HashSet < Rating > ( ) ;
this . Sources = new HashSet < MetadataProviderId > ( ) ;
Title = title ;
Language = language ;
DateAdded = DateTime . UtcNow ;
DateModified = DateAdded ;
Init ( ) ;
PersonRoles = new HashSet < PersonRole > ( ) ;
Genres = new HashSet < Genre > ( ) ;
Artwork = new HashSet < Artwork > ( ) ;
Ratings = new HashSet < Rating > ( ) ;
Sources = new HashSet < MetadataProviderId > ( ) ;
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Properties
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/// <summary>
/// Backing field for Id.
/// </summary>
internal int _Id ;
/// <summary>
/// When provided in a partial class, allows value of Id to be changed before setting .
/// Initializes a new instance of the <see cref="Metadata"/> class.
/// </summary>
partial void SetId ( int oldValue , ref int newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of Id to be changed before returning.
/// </summary>
partial void GetId ( ref int result ) ;
/// <summary>
/// Identity, Indexed, Required.
/// </summary>
[Key]
[Required]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id
/// <remarks>
/// Default constructor. Protected due to being abstract.
/// </remarks>
protected Metadata ( )
{
get
{
int value = _Id ;
GetId ( ref value ) ;
return _Id = value ;
}
protected set
{
int oldValue = _Id ;
SetId ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_Id = value ;
}
}
}
/// <summary>
/// Backing field for Title.
/// </summary>
protected string _Title ;
/// <summary>
/// When provided in a partial class, allows value of Title to be changed before setting.
/// </summary>
partial void SetTitle ( string oldValue , ref string newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of Title to be changed before returning.
/// Gets or sets the id.
/// </summary>
partial void GetTitle ( ref string result ) ;
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get ; protected set ; }
/// <summary>
/// Required, Max length = 1024
/// The title or name of the object.
/// Gets or sets the title.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[Required]
[MaxLength(1024)]
[StringLength(1024)]
public string Title
{
get
{
string value = _Title ;
GetTitle ( ref value ) ;
return _Title = value ;
}
public string Title { get ; set ; }
set
{
string oldValue = _Title ;
SetTitle ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_Title = value ;
}
}
}
/// <summary>
/// Backing field for OriginalTitle.
/// </summary>
protected string _OriginalTitle ;
/// <summary>
/// When provided in a partial class, allows value of OriginalTitle to be changed before setting.
/// </summary>
partial void SetOriginalTitle ( string oldValue , ref string newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of OriginalTitle to be changed before returning.
/// </summary>
partial void GetOriginalTitle ( ref string result ) ;
/// <summary>
/// Max length = 1024
/// Gets or sets the original title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string OriginalTitle
{
get
{
string value = _OriginalTitle ;
GetOriginalTitle ( ref value ) ;
return _OriginalTitle = value ;
}
set
{
string oldValue = _OriginalTitle ;
SetOriginalTitle ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_OriginalTitle = value ;
}
}
}
public string OriginalTitle { get ; set ; }
/// <summary>
/// Backing field for SortTitle.
/// </summary>
protected string _SortTitle ;
/// <summary>
/// When provided in a partial class, allows value of SortTitle to be changed before setting.
/// </summary>
partial void SetSortTitle ( string oldValue , ref string newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of SortTitle to be changed before returning.
/// </summary>
partial void GetSortTitle ( ref string result ) ;
/// <summary>
/// Max length = 1024
/// Gets or sets the sort title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string SortTitle
{
get
{
string value = _SortTitle ;
GetSortTitle ( ref value ) ;
return _SortTitle = value ;
}
set
{
string oldValue = _SortTitle ;
SetSortTitle ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_SortTitle = value ;
}
}
}
public string SortTitle { get ; set ; }
/// <summary>
/// Backing field for Language.
/// </summary>
protected string _Language ;
/// <summary>
/// When provided in a partial class, allows value of Language to be changed before setting.
/// Gets or sets the language.
/// </summary>
partial void SetLanguage ( string oldValue , ref string newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of Language to be changed before returning.
/// </summary>
partial void GetLanguage ( ref string result ) ;
/// <summary>
/// Required, Min length = 3, Max length = 3
/// <remarks>
/// Required, Min length = 3, Max length = 3.
/// ISO-639-3 3-character language codes.
/// </ summary >
/// </remarks>
[Required]
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language
{
get
{
string value = _Language ;
GetLanguage ( ref value ) ;
return _Language = value ;
}
set
{
string oldValue = _Language ;
SetLanguage ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_Language = value ;
}
}
}
public string Language { get ; set ; }
/// <summary>
/// Backing field for ReleaseD ate.
/// Gets or sets the release date.
/// </summary>
protected DateTimeOffset ? _ReleaseDate ;
/// <summary>
/// When provided in a partial class, allows value of ReleaseDate to be changed before setting.
/// </summary>
partial void SetReleaseDate ( DateTimeOffset ? oldValue , ref DateTimeOffset ? newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of ReleaseDate to be changed before returning.
/// </summary>
partial void GetReleaseDate ( ref DateTimeOffset ? result ) ;
public DateTimeOffset ? ReleaseDate
{
get
{
DateTimeOffset ? value = _ReleaseDate ;
GetReleaseDate ( ref value ) ;
return _ReleaseDate = value ;
}
set
{
DateTimeOffset ? oldValue = _ReleaseDate ;
SetReleaseDate ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_ReleaseDate = value ;
}
}
}
public DateTimeOffset ? ReleaseDate { get ; set ; }
/// <summary>
/// Backing field for DateA dded.
/// Gets or sets the date added.
/// </summary>
protected DateTime _DateAdded ;
/// <summary>
/// When provided in a partial class, allows value of DateAdded to be changed before setting.
/// </summary>
partial void SetDateAdded ( DateTime oldValue , ref DateTime newValue ) ;
/// <summary>
/// When provided in a partial class, allows value of DateAdded to be changed before returning.
/// </summary>
partial void GetDateAdded ( ref DateTime result ) ;
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateAdded { get ; protected set ; }
/// <summary>
/// Requir ed.
/// Gets or sets the date modified.
/// </summary>
[Required]
public DateTime DateAdded
{
get
{
DateTime value = _DateAdded ;
GetDateAdded ( ref value ) ;
return _DateAdded = value ;
}
internal set
{
DateTime oldValue = _DateAdded ;
SetDateAdded ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_DateAdded = value ;
}
}
}
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateModified { get ; set ; }
/// <summary>
/// Backing field for DateModified .
/// Gets or sets the row version.
/// </summary>
protected DateTime _DateModified ;
/// <remarks>
/// Required, ConcurrencyToken.
/// </remarks>
[ConcurrencyCheck]
public uint RowVersion { get ; set ; }
/// <summary>
/// When provided in a partial class, allows value of DateModified to be changed before setting.
/// Gets or sets a collection containing the person roles for this item.
/// </summary>
partial void SetDateModified ( DateTime oldValue , ref DateTime newValue ) ;
public virtual ICollection < PersonRole > PersonRoles { get ; protected set ; }
/// <summary>
/// When provided in a partial class, allows value of DateModified to be changed before returning .
/// Gets or sets a collection containing the generes for this item .
/// </summary>
partial void GetDateModified ( ref DateTime result ) ;
public virtual ICollection < Genre > Genres { get ; protected set ; }
/// <inheritdoc />
public virtual ICollection < Artwork > Artwork { get ; protected set ; }
/// <summary>
/// Required.
/// Gets or sets a collection containing the ratings for this item .
/// </summary>
[Required]
public DateTime DateModified
{
get
{
DateTime value = _DateModified ;
GetDateModified ( ref value ) ;
return _DateModified = value ;
}
internal set
{
DateTime oldValue = _DateModified ;
SetDateModified ( oldValue , ref value ) ;
if ( oldValue ! = value )
{
_DateModified = value ;
}
}
}
public virtual ICollection < Rating > Ratings { get ; protected set ; }
/// <summary>
/// Required, ConcurrenyToken .
/// Gets or sets a collection containing the metadata sources for this item.
/// </summary>
[ConcurrencyCheck]
[Required]
public uint RowVersion { get ; set ; }
public virtual ICollection < MetadataProviderId > Sources { get ; protected set ; }
/// <inheritdoc />
public void OnSavingChanges ( )
{
RowVersion + + ;
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Navigation properties
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
[ForeignKey("PersonRole_PersonRoles_Id")]
public virtual ICollection < PersonRole > PersonRoles { get ; protected set ; }
[ForeignKey("PersonRole_PersonRoles_Id")]
public virtual ICollection < Genre > Genres { get ; protected set ; }
[ForeignKey("PersonRole_PersonRoles_Id")]
public virtual ICollection < Artwork > Artwork { get ; protected set ; }
[ForeignKey("PersonRole_PersonRoles_Id")]
public virtual ICollection < Rating > Ratings { get ; protected set ; }
[ForeignKey("PersonRole_PersonRoles_Id")]
public virtual ICollection < MetadataProviderId > Sources { get ; protected set ; }
}
}