SeriesMetadata.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 SeriesMetadata : 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 SeriesMetadata()
  14. {
  15. Networks = 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 SeriesMetadata CreateSeriesMetadataUnsafe()
  22. {
  23. return new SeriesMetadata();
  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="_series0"></param>
  31. public SeriesMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Series _series0)
  32. {
  33. if (string.IsNullOrEmpty(title))
  34. {
  35. throw new ArgumentNullException(nameof(title));
  36. }
  37. this.Title = title;
  38. if (string.IsNullOrEmpty(language))
  39. {
  40. throw new ArgumentNullException(nameof(language));
  41. }
  42. this.Language = language;
  43. if (_series0 == null)
  44. {
  45. throw new ArgumentNullException(nameof(_series0));
  46. }
  47. _series0.SeriesMetadata.Add(this);
  48. this.Networks = new HashSet<Company>();
  49. Init();
  50. }
  51. /// <summary>
  52. /// Static create function (for use in LINQ queries, etc.)
  53. /// </summary>
  54. /// <param name="title">The title or name of the object.</param>
  55. /// <param name="language">ISO-639-3 3-character language codes.</param>
  56. /// <param name="_series0"></param>
  57. public static SeriesMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Series _series0)
  58. {
  59. return new SeriesMetadata(title, language, dateadded, datemodified, _series0);
  60. }
  61. /*************************************************************************
  62. * Properties
  63. *************************************************************************/
  64. /// <summary>
  65. /// Backing field for Outline.
  66. /// </summary>
  67. protected string _Outline;
  68. /// <summary>
  69. /// When provided in a partial class, allows value of Outline to be changed before setting.
  70. /// </summary>
  71. partial void SetOutline(string oldValue, ref string newValue);
  72. /// <summary>
  73. /// When provided in a partial class, allows value of Outline to be changed before returning.
  74. /// </summary>
  75. partial void GetOutline(ref string result);
  76. /// <summary>
  77. /// Max length = 1024
  78. /// </summary>
  79. [MaxLength(1024)]
  80. [StringLength(1024)]
  81. public string Outline
  82. {
  83. get
  84. {
  85. string value = _Outline;
  86. GetOutline(ref value);
  87. return _Outline = value;
  88. }
  89. set
  90. {
  91. string oldValue = _Outline;
  92. SetOutline(oldValue, ref value);
  93. if (oldValue != value)
  94. {
  95. _Outline = value;
  96. }
  97. }
  98. }
  99. /// <summary>
  100. /// Backing field for Plot.
  101. /// </summary>
  102. protected string _Plot;
  103. /// <summary>
  104. /// When provided in a partial class, allows value of Plot to be changed before setting.
  105. /// </summary>
  106. partial void SetPlot(string oldValue, ref string newValue);
  107. /// <summary>
  108. /// When provided in a partial class, allows value of Plot to be changed before returning.
  109. /// </summary>
  110. partial void GetPlot(ref string result);
  111. /// <summary>
  112. /// Max length = 65535
  113. /// </summary>
  114. [MaxLength(65535)]
  115. [StringLength(65535)]
  116. public string Plot
  117. {
  118. get
  119. {
  120. string value = _Plot;
  121. GetPlot(ref value);
  122. return _Plot = value;
  123. }
  124. set
  125. {
  126. string oldValue = _Plot;
  127. SetPlot(oldValue, ref value);
  128. if (oldValue != value)
  129. {
  130. _Plot = value;
  131. }
  132. }
  133. }
  134. /// <summary>
  135. /// Backing field for Tagline.
  136. /// </summary>
  137. protected string _Tagline;
  138. /// <summary>
  139. /// When provided in a partial class, allows value of Tagline to be changed before setting.
  140. /// </summary>
  141. partial void SetTagline(string oldValue, ref string newValue);
  142. /// <summary>
  143. /// When provided in a partial class, allows value of Tagline to be changed before returning.
  144. /// </summary>
  145. partial void GetTagline(ref string result);
  146. /// <summary>
  147. /// Max length = 1024
  148. /// </summary>
  149. [MaxLength(1024)]
  150. [StringLength(1024)]
  151. public string Tagline
  152. {
  153. get
  154. {
  155. string value = _Tagline;
  156. GetTagline(ref value);
  157. return _Tagline = value;
  158. }
  159. set
  160. {
  161. string oldValue = _Tagline;
  162. SetTagline(oldValue, ref value);
  163. if (oldValue != value)
  164. {
  165. _Tagline = value;
  166. }
  167. }
  168. }
  169. /// <summary>
  170. /// Backing field for Country.
  171. /// </summary>
  172. protected string _Country;
  173. /// <summary>
  174. /// When provided in a partial class, allows value of Country to be changed before setting.
  175. /// </summary>
  176. partial void SetCountry(string oldValue, ref string newValue);
  177. /// <summary>
  178. /// When provided in a partial class, allows value of Country to be changed before returning.
  179. /// </summary>
  180. partial void GetCountry(ref string result);
  181. /// <summary>
  182. /// Max length = 2
  183. /// </summary>
  184. [MaxLength(2)]
  185. [StringLength(2)]
  186. public string Country
  187. {
  188. get
  189. {
  190. string value = _Country;
  191. GetCountry(ref value);
  192. return _Country = value;
  193. }
  194. set
  195. {
  196. string oldValue = _Country;
  197. SetCountry(oldValue, ref value);
  198. if (oldValue != value)
  199. {
  200. _Country = value;
  201. }
  202. }
  203. }
  204. /*************************************************************************
  205. * Navigation properties
  206. *************************************************************************/
  207. [ForeignKey("Company_Networks_Id")]
  208. public virtual ICollection<Company> Networks { get; protected set; }
  209. }
  210. }