diff options
Diffstat (limited to 'Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs')
| -rw-r--r-- | Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs | 77 |
1 files changed, 15 insertions, 62 deletions
diff --git a/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs b/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs index 8606302d7..bc1835528 100644 --- a/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs +++ b/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs @@ -1,83 +1,36 @@ -#pragma warning disable CS1591 - using System; namespace Jellyfin.Data.Entities.Libraries { - public partial class CustomItemMetadata : Metadata + /// <summary> + /// An entity containing metadata for a custom item. + /// </summary> + public class CustomItemMetadata : Metadata { - partial void Init(); - /// <summary> - /// Default constructor. Protected due to required properties, but present because EF needs it. - /// </summary> - protected CustomItemMetadata() - { - Init(); - } - - /// <summary> - /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving. - /// </summary> - public static CustomItemMetadata CreateCustomItemMetadataUnsafe() - { - return new CustomItemMetadata(); - } - - /// <summary> - /// Public constructor with required data. + /// Initializes a new instance of the <see cref="CustomItemMetadata"/> 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> - /// <param name="_customitem0"></param> - public CustomItemMetadata(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0) + /// <param name="item">The item.</param> + public CustomItemMetadata(string title, string language, CustomItem item) : base(title, 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; - - if (_customitem0 == null) + if (item == null) { - throw new ArgumentNullException(nameof(_customitem0)); + throw new ArgumentNullException(nameof(item)); } - _customitem0.CustomItemMetadata.Add(this); - - Init(); + item.CustomItemMetadata.Add(this); } /// <summary> - /// Static create function (for use in LINQ queries, etc.) + /// Initializes a new instance of the <see cref="CustomItemMetadata"/> 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> - /// <param name="_customitem0"></param> - public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0) + /// <remarks> + /// Default constructor. Protected due to required properties, but present because EF needs it. + /// </remarks> + protected CustomItemMetadata() { - return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0); } - - /************************************************************************* - * Properties - *************************************************************************/ - - /************************************************************************* - * Navigation properties - *************************************************************************/ } } - |
