EpisodeMetadata.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. namespace Jellyfin.Data.Entities
  4. {
  5. public partial class EpisodeMetadata : Metadata
  6. {
  7. partial void Init();
  8. /// <summary>
  9. /// Default constructor. Protected due to required properties, but present because EF needs it.
  10. /// </summary>
  11. protected EpisodeMetadata()
  12. {
  13. Init();
  14. }
  15. /// <summary>
  16. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  17. /// </summary>
  18. public static EpisodeMetadata CreateEpisodeMetadataUnsafe()
  19. {
  20. return new EpisodeMetadata();
  21. }
  22. /// <summary>
  23. /// Public constructor with required data.
  24. /// </summary>
  25. /// <param name="title">The title or name of the object.</param>
  26. /// <param name="language">ISO-639-3 3-character language codes.</param>
  27. /// <param name="_episode0"></param>
  28. public EpisodeMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
  29. {
  30. if (string.IsNullOrEmpty(title))
  31. {
  32. throw new ArgumentNullException(nameof(title));
  33. }
  34. this.Title = title;
  35. if (string.IsNullOrEmpty(language))
  36. {
  37. throw new ArgumentNullException(nameof(language));
  38. }
  39. this.Language = language;
  40. if (_episode0 == null)
  41. {
  42. throw new ArgumentNullException(nameof(_episode0));
  43. }
  44. _episode0.EpisodeMetadata.Add(this);
  45. Init();
  46. }
  47. /// <summary>
  48. /// Static create function (for use in LINQ queries, etc.)
  49. /// </summary>
  50. /// <param name="title">The title or name of the object.</param>
  51. /// <param name="language">ISO-639-3 3-character language codes.</param>
  52. /// <param name="_episode0"></param>
  53. public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
  54. {
  55. return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0);
  56. }
  57. /*************************************************************************
  58. * Properties
  59. *************************************************************************/
  60. /// <summary>
  61. /// Backing field for Outline.
  62. /// </summary>
  63. protected string _Outline;
  64. /// <summary>
  65. /// When provided in a partial class, allows value of Outline to be changed before setting.
  66. /// </summary>
  67. partial void SetOutline(string oldValue, ref string newValue);
  68. /// <summary>
  69. /// When provided in a partial class, allows value of Outline to be changed before returning.
  70. /// </summary>
  71. partial void GetOutline(ref string result);
  72. /// <summary>
  73. /// Max length = 1024
  74. /// </summary>
  75. [MaxLength(1024)]
  76. [StringLength(1024)]
  77. public string Outline
  78. {
  79. get
  80. {
  81. string value = _Outline;
  82. GetOutline(ref value);
  83. return _Outline = value;
  84. }
  85. set
  86. {
  87. string oldValue = _Outline;
  88. SetOutline(oldValue, ref value);
  89. if (oldValue != value)
  90. {
  91. _Outline = value;
  92. }
  93. }
  94. }
  95. /// <summary>
  96. /// Backing field for Plot.
  97. /// </summary>
  98. protected string _Plot;
  99. /// <summary>
  100. /// When provided in a partial class, allows value of Plot to be changed before setting.
  101. /// </summary>
  102. partial void SetPlot(string oldValue, ref string newValue);
  103. /// <summary>
  104. /// When provided in a partial class, allows value of Plot to be changed before returning.
  105. /// </summary>
  106. partial void GetPlot(ref string result);
  107. /// <summary>
  108. /// Max length = 65535
  109. /// </summary>
  110. [MaxLength(65535)]
  111. [StringLength(65535)]
  112. public string Plot
  113. {
  114. get
  115. {
  116. string value = _Plot;
  117. GetPlot(ref value);
  118. return _Plot = value;
  119. }
  120. set
  121. {
  122. string oldValue = _Plot;
  123. SetPlot(oldValue, ref value);
  124. if (oldValue != value)
  125. {
  126. _Plot = value;
  127. }
  128. }
  129. }
  130. /// <summary>
  131. /// Backing field for Tagline.
  132. /// </summary>
  133. protected string _Tagline;
  134. /// <summary>
  135. /// When provided in a partial class, allows value of Tagline to be changed before setting.
  136. /// </summary>
  137. partial void SetTagline(string oldValue, ref string newValue);
  138. /// <summary>
  139. /// When provided in a partial class, allows value of Tagline to be changed before returning.
  140. /// </summary>
  141. partial void GetTagline(ref string result);
  142. /// <summary>
  143. /// Max length = 1024
  144. /// </summary>
  145. [MaxLength(1024)]
  146. [StringLength(1024)]
  147. public string Tagline
  148. {
  149. get
  150. {
  151. string value = _Tagline;
  152. GetTagline(ref value);
  153. return _Tagline = value;
  154. }
  155. set
  156. {
  157. string oldValue = _Tagline;
  158. SetTagline(oldValue, ref value);
  159. if (oldValue != value)
  160. {
  161. _Tagline = value;
  162. }
  163. }
  164. }
  165. /*************************************************************************
  166. * Navigation properties
  167. *************************************************************************/
  168. }
  169. }