Season.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma warning disable CA2227
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Jellyfin.Data.Entities.Libraries
  5. {
  6. /// <summary>
  7. /// An entity representing a season.
  8. /// </summary>
  9. public class Season : LibraryItem
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="Season"/> class.
  13. /// </summary>
  14. /// <param name="series">The series.</param>
  15. public Season(Series series)
  16. {
  17. if (series == null)
  18. {
  19. throw new ArgumentNullException(nameof(series));
  20. }
  21. series.Seasons.Add(this);
  22. Episodes = new HashSet<Episode>();
  23. SeasonMetadata = new HashSet<SeasonMetadata>();
  24. }
  25. /// <summary>
  26. /// Initializes a new instance of the <see cref="Season"/> class.
  27. /// </summary>
  28. /// <remarks>
  29. /// Default constructor. Protected due to required properties, but present because EF needs it.
  30. /// </remarks>
  31. protected Season()
  32. {
  33. }
  34. /// <summary>
  35. /// Gets or sets the season number.
  36. /// </summary>
  37. public int? SeasonNumber { get; set; }
  38. /// <summary>
  39. /// Gets or sets the season metadata.
  40. /// </summary>
  41. public virtual ICollection<SeasonMetadata> SeasonMetadata { get; protected set; }
  42. /// <summary>
  43. /// Gets or sets a collection containing the number of episodes.
  44. /// </summary>
  45. public virtual ICollection<Episode> Episodes { get; protected set; }
  46. }
  47. }