MovieMetadata.cs 7.1 KB

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