TimerInfo.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. #nullable disable
  2. #pragma warning disable CS1591
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text.Json.Serialization;
  7. using MediaBrowser.Model.LiveTv;
  8. namespace MediaBrowser.Controller.LiveTv
  9. {
  10. public class TimerInfo
  11. {
  12. public TimerInfo()
  13. {
  14. Genres = Array.Empty<string>();
  15. KeepUntil = KeepUntil.UntilDeleted;
  16. ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  17. SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  18. Tags = Array.Empty<string>();
  19. }
  20. public Dictionary<string, string> ProviderIds { get; set; }
  21. public Dictionary<string, string> SeriesProviderIds { get; set; }
  22. public string[] Tags { get; set; }
  23. /// <summary>
  24. /// Id of the recording.
  25. /// </summary>
  26. public string Id { get; set; }
  27. /// <summary>
  28. /// Gets or sets the series timer identifier.
  29. /// </summary>
  30. /// <value>The series timer identifier.</value>
  31. public string SeriesTimerId { get; set; }
  32. /// <summary>
  33. /// ChannelId of the recording.
  34. /// </summary>
  35. public string ChannelId { get; set; }
  36. /// <summary>
  37. /// Gets or sets the program identifier.
  38. /// </summary>
  39. /// <value>The program identifier.</value>
  40. public string ProgramId { get; set; }
  41. public string ShowId { get; set; }
  42. /// <summary>
  43. /// Name of the recording.
  44. /// </summary>
  45. public string Name { get; set; }
  46. /// <summary>
  47. /// Description of the recording.
  48. /// </summary>
  49. public string Overview { get; set; }
  50. public string SeriesId { get; set; }
  51. /// <summary>
  52. /// The start date of the recording, in UTC.
  53. /// </summary>
  54. public DateTime StartDate { get; set; }
  55. /// <summary>
  56. /// The end date of the recording, in UTC.
  57. /// </summary>
  58. public DateTime EndDate { get; set; }
  59. /// <summary>
  60. /// Gets or sets the status.
  61. /// </summary>
  62. /// <value>The status.</value>
  63. public RecordingStatus Status { get; set; }
  64. /// <summary>
  65. /// Gets or sets the pre padding seconds.
  66. /// </summary>
  67. /// <value>The pre padding seconds.</value>
  68. public int PrePaddingSeconds { get; set; }
  69. /// <summary>
  70. /// Gets or sets the post padding seconds.
  71. /// </summary>
  72. /// <value>The post padding seconds.</value>
  73. public int PostPaddingSeconds { get; set; }
  74. /// <summary>
  75. /// Gets or sets a value indicating whether this instance is pre padding required.
  76. /// </summary>
  77. /// <value><c>true</c> if this instance is pre padding required; otherwise, <c>false</c>.</value>
  78. public bool IsPrePaddingRequired { get; set; }
  79. /// <summary>
  80. /// Gets or sets a value indicating whether this instance is post padding required.
  81. /// </summary>
  82. /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value>
  83. public bool IsPostPaddingRequired { get; set; }
  84. public bool IsManual { get; set; }
  85. /// <summary>
  86. /// Gets or sets the priority.
  87. /// </summary>
  88. /// <value>The priority.</value>
  89. public int Priority { get; set; }
  90. public int RetryCount { get; set; }
  91. // Program properties
  92. public int? SeasonNumber { get; set; }
  93. /// <summary>
  94. /// Gets or sets the episode number.
  95. /// </summary>
  96. /// <value>The episode number.</value>
  97. public int? EpisodeNumber { get; set; }
  98. public bool IsMovie { get; set; }
  99. public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
  100. public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
  101. public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
  102. public bool IsSeries { get; set; }
  103. /// <summary>
  104. /// Gets or sets a value indicating whether this instance is live.
  105. /// </summary>
  106. /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
  107. [JsonIgnore]
  108. public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
  109. [JsonIgnore]
  110. public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
  111. public int? ProductionYear { get; set; }
  112. public string EpisodeTitle { get; set; }
  113. public DateTime? OriginalAirDate { get; set; }
  114. public bool IsProgramSeries { get; set; }
  115. public bool IsRepeat { get; set; }
  116. public string HomePageUrl { get; set; }
  117. public float? CommunityRating { get; set; }
  118. public string OfficialRating { get; set; }
  119. public string[] Genres { get; set; }
  120. public string RecordingPath { get; set; }
  121. public KeepUntil KeepUntil { get; set; }
  122. }
  123. }