Season.cs 1.5 KB

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