aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-08-30 18:50:54 -0400
committerPatrick Barron <barronpm@gmail.com>2020-08-30 18:51:31 -0400
commitacb213e4b8edf1c55f615fa8d0079f0fb7fdea68 (patch)
tree7ce91e5269da6847b04631071e6f8a1a3355c56d /Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs
parent414bedbde4b6c522d46ed7448eb9f7c97aeda4b4 (diff)
First pass at cleaning entity classes.
- Documents all library entities - Fixes styling warnings for library entities - Updates library entities to inherit from interfaces - Makes library entites no longer partial.
Diffstat (limited to 'Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs')
-rw-r--r--Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs77
1 files changed, 15 insertions, 62 deletions
diff --git a/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs b/Jellyfin.Data/Entities/Libraries/CustomItemMetadata.cs
index 8606302d7d..bc18355281 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
- *************************************************************************/
}
}
-