Series.cs 5.3 KB

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