TimerInfo.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #nullable disable
  2. #pragma warning disable CS1591
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text.Json.Serialization;
  6. using Jellyfin.Extensions;
  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. /// Gets or sets the 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. public string SeriesTimerId { get; set; }
  31. /// <summary>
  32. /// Gets or sets the channelId of the recording.
  33. /// </summary>
  34. public string ChannelId { get; set; }
  35. /// <summary>
  36. /// Gets or sets the program identifier.
  37. /// </summary>
  38. /// <value>The program identifier.</value>
  39. public string ProgramId { get; set; }
  40. public string ShowId { get; set; }
  41. /// <summary>
  42. /// Gets or sets the name of the recording.
  43. /// </summary>
  44. public string Name { get; set; }
  45. /// <summary>
  46. /// Gets or sets the description of the recording.
  47. /// </summary>
  48. public string Overview { get; set; }
  49. public string SeriesId { get; set; }
  50. /// <summary>
  51. /// Gets or sets the start date of the recording, in UTC.
  52. /// </summary>
  53. public DateTime StartDate { get; set; }
  54. /// <summary>
  55. /// Gets or sets the end date of the recording, in UTC.
  56. /// </summary>
  57. public DateTime EndDate { get; set; }
  58. /// <summary>
  59. /// Gets or sets the status.
  60. /// </summary>
  61. /// <value>The status.</value>
  62. public RecordingStatus Status { get; set; }
  63. /// <summary>
  64. /// Gets or sets the pre padding seconds.
  65. /// </summary>
  66. /// <value>The pre padding seconds.</value>
  67. public int PrePaddingSeconds { get; set; }
  68. /// <summary>
  69. /// Gets or sets the post padding seconds.
  70. /// </summary>
  71. /// <value>The post padding seconds.</value>
  72. public int PostPaddingSeconds { get; set; }
  73. /// <summary>
  74. /// Gets or sets a value indicating whether this instance is pre padding required.
  75. /// </summary>
  76. /// <value><c>true</c> if this instance is pre padding required; otherwise, <c>false</c>.</value>
  77. public bool IsPrePaddingRequired { get; set; }
  78. /// <summary>
  79. /// Gets or sets a value indicating whether this instance is post padding required.
  80. /// </summary>
  81. /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value>
  82. public bool IsPostPaddingRequired { get; set; }
  83. public bool IsManual { get; set; }
  84. /// <summary>
  85. /// Gets or sets the priority.
  86. /// </summary>
  87. /// <value>The priority.</value>
  88. public int Priority { get; set; }
  89. public int RetryCount { get; set; }
  90. // Program properties
  91. public int? SeasonNumber { get; set; }
  92. /// <summary>
  93. /// Gets or sets the episode number.
  94. /// </summary>
  95. /// <value>The episode number.</value>
  96. public int? EpisodeNumber { get; set; }
  97. public bool IsMovie { get; set; }
  98. public bool IsKids => Tags.Contains("Kids", StringComparison.OrdinalIgnoreCase);
  99. public bool IsSports => Tags.Contains("Sports", StringComparison.OrdinalIgnoreCase);
  100. public bool IsNews => Tags.Contains("News", StringComparison.OrdinalIgnoreCase);
  101. public bool IsSeries { get; set; }
  102. /// <summary>
  103. /// Gets a value indicating whether this instance is live.
  104. /// </summary>
  105. /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
  106. [JsonIgnore]
  107. public bool IsLive => Tags.Contains("Live", StringComparison.OrdinalIgnoreCase);
  108. [JsonIgnore]
  109. public bool IsPremiere => Tags.Contains("Premiere", StringComparison.OrdinalIgnoreCase);
  110. public int? ProductionYear { get; set; }
  111. public string EpisodeTitle { get; set; }
  112. public DateTime? OriginalAirDate { get; set; }
  113. public bool IsProgramSeries { get; set; }
  114. public bool IsRepeat { get; set; }
  115. public string HomePageUrl { get; set; }
  116. public float? CommunityRating { get; set; }
  117. public string OfficialRating { get; set; }
  118. public string[] Genres { get; set; }
  119. public string RecordingPath { get; set; }
  120. public KeepUntil KeepUntil { get; set; }
  121. }
  122. }