EpisodeMetadata.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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)) throw new ArgumentNullException(nameof(title));
  31. this.Title = title;
  32. if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
  33. this.Language = language;
  34. if (_episode0 == null) throw new ArgumentNullException(nameof(_episode0));
  35. _episode0.EpisodeMetadata.Add(this);
  36. Init();
  37. }
  38. /// <summary>
  39. /// Static create function (for use in LINQ queries, etc.)
  40. /// </summary>
  41. /// <param name="title">The title or name of the object</param>
  42. /// <param name="language">ISO-639-3 3-character language codes</param>
  43. /// <param name="_episode0"></param>
  44. public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
  45. {
  46. return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0);
  47. }
  48. /*************************************************************************
  49. * Properties
  50. *************************************************************************/
  51. /// <summary>
  52. /// Backing field for Outline
  53. /// </summary>
  54. protected string _Outline;
  55. /// <summary>
  56. /// When provided in a partial class, allows value of Outline to be changed before setting.
  57. /// </summary>
  58. partial void SetOutline(string oldValue, ref string newValue);
  59. /// <summary>
  60. /// When provided in a partial class, allows value of Outline to be changed before returning.
  61. /// </summary>
  62. partial void GetOutline(ref string result);
  63. /// <summary>
  64. /// Max length = 1024
  65. /// </summary>
  66. [MaxLength(1024)]
  67. [StringLength(1024)]
  68. public string Outline
  69. {
  70. get
  71. {
  72. string value = _Outline;
  73. GetOutline(ref value);
  74. return (_Outline = value);
  75. }
  76. set
  77. {
  78. string oldValue = _Outline;
  79. SetOutline(oldValue, ref value);
  80. if (oldValue != value)
  81. {
  82. _Outline = value;
  83. }
  84. }
  85. }
  86. /// <summary>
  87. /// Backing field for Plot
  88. /// </summary>
  89. protected string _Plot;
  90. /// <summary>
  91. /// When provided in a partial class, allows value of Plot to be changed before setting.
  92. /// </summary>
  93. partial void SetPlot(string oldValue, ref string newValue);
  94. /// <summary>
  95. /// When provided in a partial class, allows value of Plot to be changed before returning.
  96. /// </summary>
  97. partial void GetPlot(ref string result);
  98. /// <summary>
  99. /// Max length = 65535
  100. /// </summary>
  101. [MaxLength(65535)]
  102. [StringLength(65535)]
  103. public string Plot
  104. {
  105. get
  106. {
  107. string value = _Plot;
  108. GetPlot(ref value);
  109. return (_Plot = value);
  110. }
  111. set
  112. {
  113. string oldValue = _Plot;
  114. SetPlot(oldValue, ref value);
  115. if (oldValue != value)
  116. {
  117. _Plot = value;
  118. }
  119. }
  120. }
  121. /// <summary>
  122. /// Backing field for Tagline
  123. /// </summary>
  124. protected string _Tagline;
  125. /// <summary>
  126. /// When provided in a partial class, allows value of Tagline to be changed before setting.
  127. /// </summary>
  128. partial void SetTagline(string oldValue, ref string newValue);
  129. /// <summary>
  130. /// When provided in a partial class, allows value of Tagline to be changed before returning.
  131. /// </summary>
  132. partial void GetTagline(ref string result);
  133. /// <summary>
  134. /// Max length = 1024
  135. /// </summary>
  136. [MaxLength(1024)]
  137. [StringLength(1024)]
  138. public string Tagline
  139. {
  140. get
  141. {
  142. string value = _Tagline;
  143. GetTagline(ref value);
  144. return (_Tagline = value);
  145. }
  146. set
  147. {
  148. string oldValue = _Tagline;
  149. SetTagline(oldValue, ref value);
  150. if (oldValue != value)
  151. {
  152. _Tagline = value;
  153. }
  154. }
  155. }
  156. /*************************************************************************
  157. * Navigation properties
  158. *************************************************************************/
  159. }
  160. }