MovieMetadata.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. namespace Jellyfin.Data.Entities
  7. {
  8. public partial class MovieMetadata : Metadata
  9. {
  10. partial void Init();
  11. /// <summary>
  12. /// Default constructor. Protected due to required properties, but present because EF needs it.
  13. /// </summary>
  14. protected MovieMetadata()
  15. {
  16. Studios = new HashSet<Company>();
  17. Init();
  18. }
  19. /// <summary>
  20. /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
  21. /// </summary>
  22. public static MovieMetadata CreateMovieMetadataUnsafe()
  23. {
  24. return new MovieMetadata();
  25. }
  26. /// <summary>
  27. /// Public constructor with required data.
  28. /// </summary>
  29. /// <param name="title">The title or name of the object.</param>
  30. /// <param name="language">ISO-639-3 3-character language codes.</param>
  31. /// <param name="dateadded">The date the object was added.</param>
  32. /// <param name="datemodified">The date the object was last modified.</param>
  33. /// <param name="_movie0"></param>
  34. public MovieMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Movie _movie0)
  35. {
  36. if (string.IsNullOrEmpty(title))
  37. {
  38. throw new ArgumentNullException(nameof(title));
  39. }
  40. this.Title = title;
  41. if (string.IsNullOrEmpty(language))
  42. {
  43. throw new ArgumentNullException(nameof(language));
  44. }
  45. this.Language = language;
  46. if (_movie0 == null)
  47. {
  48. throw new ArgumentNullException(nameof(_movie0));
  49. }
  50. _movie0.MovieMetadata.Add(this);
  51. this.Studios = new HashSet<Company>();
  52. Init();
  53. }
  54. /// <summary>
  55. /// Static create function (for use in LINQ queries, etc.)
  56. /// </summary>
  57. /// <param name="title">The title or name of the object.</param>
  58. /// <param name="language">ISO-639-3 3-character language codes.</param>
  59. /// <param name="dateadded">The date the object was added.</param>
  60. /// <param name="datemodified">The date the object was last modified.</param>
  61. /// <param name="_movie0"></param>
  62. public static MovieMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Movie _movie0)
  63. {
  64. return new MovieMetadata(title, language, dateadded, datemodified, _movie0);
  65. }
  66. /*************************************************************************
  67. * Properties
  68. *************************************************************************/
  69. /// <summary>
  70. /// Backing field for Outline.
  71. /// </summary>
  72. protected string _Outline;
  73. /// <summary>
  74. /// When provided in a partial class, allows value of Outline to be changed before setting.
  75. /// </summary>
  76. partial void SetOutline(string oldValue, ref string newValue);
  77. /// <summary>
  78. /// When provided in a partial class, allows value of Outline to be changed before returning.
  79. /// </summary>
  80. partial void GetOutline(ref string result);
  81. /// <summary>
  82. /// Max length = 1024
  83. /// </summary>
  84. [MaxLength(1024)]
  85. [StringLength(1024)]
  86. public string Outline
  87. {
  88. get
  89. {
  90. string value = _Outline;
  91. GetOutline(ref value);
  92. return _Outline = value;
  93. }
  94. set
  95. {
  96. string oldValue = _Outline;
  97. SetOutline(oldValue, ref value);
  98. if (oldValue != value)
  99. {
  100. _Outline = value;
  101. }
  102. }
  103. }
  104. /// <summary>
  105. /// Backing field for Plot.
  106. /// </summary>
  107. protected string _Plot;
  108. /// <summary>
  109. /// When provided in a partial class, allows value of Plot to be changed before setting.
  110. /// </summary>
  111. partial void SetPlot(string oldValue, ref string newValue);
  112. /// <summary>
  113. /// When provided in a partial class, allows value of Plot to be changed before returning.
  114. /// </summary>
  115. partial void GetPlot(ref string result);
  116. /// <summary>
  117. /// Max length = 65535
  118. /// </summary>
  119. [MaxLength(65535)]
  120. [StringLength(65535)]
  121. public string Plot
  122. {
  123. get
  124. {
  125. string value = _Plot;
  126. GetPlot(ref value);
  127. return _Plot = value;
  128. }
  129. set
  130. {
  131. string oldValue = _Plot;
  132. SetPlot(oldValue, ref value);
  133. if (oldValue != value)
  134. {
  135. _Plot = value;
  136. }
  137. }
  138. }
  139. /// <summary>
  140. /// Backing field for Tagline.
  141. /// </summary>
  142. protected string _Tagline;
  143. /// <summary>
  144. /// When provided in a partial class, allows value of Tagline to be changed before setting.
  145. /// </summary>
  146. partial void SetTagline(string oldValue, ref string newValue);
  147. /// <summary>
  148. /// When provided in a partial class, allows value of Tagline to be changed before returning.
  149. /// </summary>
  150. partial void GetTagline(ref string result);
  151. /// <summary>
  152. /// Max length = 1024
  153. /// </summary>
  154. [MaxLength(1024)]
  155. [StringLength(1024)]
  156. public string Tagline
  157. {
  158. get
  159. {
  160. string value = _Tagline;
  161. GetTagline(ref value);
  162. return _Tagline = value;
  163. }
  164. set
  165. {
  166. string oldValue = _Tagline;
  167. SetTagline(oldValue, ref value);
  168. if (oldValue != value)
  169. {
  170. _Tagline = value;
  171. }
  172. }
  173. }
  174. /// <summary>
  175. /// Backing field for Country.
  176. /// </summary>
  177. protected string _Country;
  178. /// <summary>
  179. /// When provided in a partial class, allows value of Country to be changed before setting.
  180. /// </summary>
  181. partial void SetCountry(string oldValue, ref string newValue);
  182. /// <summary>
  183. /// When provided in a partial class, allows value of Country to be changed before returning.
  184. /// </summary>
  185. partial void GetCountry(ref string result);
  186. /// <summary>
  187. /// Max length = 2
  188. /// </summary>
  189. [MaxLength(2)]
  190. [StringLength(2)]
  191. public string Country
  192. {
  193. get
  194. {
  195. string value = _Country;
  196. GetCountry(ref value);
  197. return _Country = value;
  198. }
  199. set
  200. {
  201. string oldValue = _Country;
  202. SetCountry(oldValue, ref value);
  203. if (oldValue != value)
  204. {
  205. _Country = value;
  206. }
  207. }
  208. }
  209. /*************************************************************************
  210. * Navigation properties
  211. *************************************************************************/
  212. [ForeignKey("Company_Studios_Id")]
  213. public virtual ICollection<Company> Studios { get; protected set; }
  214. }
  215. }