Series.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace Jellyfin.Data.Entities
  5. {
  6. public partial class Series : LibraryItem
  7. {
  8. partial void Init();
  9. /// <summary>
  10. /// Default constructor. Protected due to required properties, but present because EF needs it.
  11. /// </summary>
  12. protected Series()
  13. {
  14. SeriesMetadata = new HashSet<SeriesMetadata>();
  15. Seasons = new HashSet<Season>();
  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 Series CreateSeriesUnsafe()
  22. {
  23. return new Series();
  24. }
  25. /// <summary>
  26. /// Public constructor with required data
  27. /// </summary>
  28. /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
  29. public Series(Guid urlid, DateTime dateadded)
  30. {
  31. this.UrlId = urlid;
  32. this.SeriesMetadata = new HashSet<SeriesMetadata>();
  33. this.Seasons = new HashSet<Season>();
  34. Init();
  35. }
  36. /// <summary>
  37. /// Static create function (for use in LINQ queries, etc.)
  38. /// </summary>
  39. /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
  40. public static Series Create(Guid urlid, DateTime dateadded)
  41. {
  42. return new Series(urlid, dateadded);
  43. }
  44. /*************************************************************************
  45. * Properties
  46. *************************************************************************/
  47. /// <summary>
  48. /// Backing field for AirsDayOfWeek
  49. /// </summary>
  50. protected Enums.Weekday? _AirsDayOfWeek;
  51. /// <summary>
  52. /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting.
  53. /// </summary>
  54. partial void SetAirsDayOfWeek(Enums.Weekday? oldValue, ref Enums.Weekday? newValue);
  55. /// <summary>
  56. /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning.
  57. /// </summary>
  58. partial void GetAirsDayOfWeek(ref Enums.Weekday? result);
  59. public Enums.Weekday? AirsDayOfWeek
  60. {
  61. get
  62. {
  63. Enums.Weekday? value = _AirsDayOfWeek;
  64. GetAirsDayOfWeek(ref value);
  65. return (_AirsDayOfWeek = value);
  66. }
  67. set
  68. {
  69. Enums.Weekday? oldValue = _AirsDayOfWeek;
  70. SetAirsDayOfWeek(oldValue, ref value);
  71. if (oldValue != value)
  72. {
  73. _AirsDayOfWeek = value;
  74. }
  75. }
  76. }
  77. /// <summary>
  78. /// Backing field for AirsTime
  79. /// </summary>
  80. protected DateTimeOffset? _AirsTime;
  81. /// <summary>
  82. /// When provided in a partial class, allows value of AirsTime to be changed before setting.
  83. /// </summary>
  84. partial void SetAirsTime(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
  85. /// <summary>
  86. /// When provided in a partial class, allows value of AirsTime to be changed before returning.
  87. /// </summary>
  88. partial void GetAirsTime(ref DateTimeOffset? result);
  89. /// <summary>
  90. /// The time the show airs, ignore the date portion
  91. /// </summary>
  92. public DateTimeOffset? AirsTime
  93. {
  94. get
  95. {
  96. DateTimeOffset? value = _AirsTime;
  97. GetAirsTime(ref value);
  98. return (_AirsTime = value);
  99. }
  100. set
  101. {
  102. DateTimeOffset? oldValue = _AirsTime;
  103. SetAirsTime(oldValue, ref value);
  104. if (oldValue != value)
  105. {
  106. _AirsTime = value;
  107. }
  108. }
  109. }
  110. /// <summary>
  111. /// Backing field for FirstAired
  112. /// </summary>
  113. protected DateTimeOffset? _FirstAired;
  114. /// <summary>
  115. /// When provided in a partial class, allows value of FirstAired to be changed before setting.
  116. /// </summary>
  117. partial void SetFirstAired(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
  118. /// <summary>
  119. /// When provided in a partial class, allows value of FirstAired to be changed before returning.
  120. /// </summary>
  121. partial void GetFirstAired(ref DateTimeOffset? result);
  122. public DateTimeOffset? FirstAired
  123. {
  124. get
  125. {
  126. DateTimeOffset? value = _FirstAired;
  127. GetFirstAired(ref value);
  128. return (_FirstAired = value);
  129. }
  130. set
  131. {
  132. DateTimeOffset? oldValue = _FirstAired;
  133. SetFirstAired(oldValue, ref value);
  134. if (oldValue != value)
  135. {
  136. _FirstAired = value;
  137. }
  138. }
  139. }
  140. /*************************************************************************
  141. * Navigation properties
  142. *************************************************************************/
  143. [ForeignKey("SeriesMetadata_SeriesMetadata_Id")]
  144. public virtual ICollection<SeriesMetadata> SeriesMetadata { get; protected set; }
  145. [ForeignKey("Season_Seasons_Id")]
  146. public virtual ICollection<Season> Seasons { get; protected set; }
  147. }
  148. }