aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/LiveTv
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2026-05-06 20:49:19 +0200
committerGitHub <noreply@github.com>2026-05-06 20:49:19 +0200
commit33ed52b8ee25e1fae4763a26337b838dc9782b26 (patch)
treeee68da202f604eef267254ea8c689965098b1c3e /MediaBrowser.Controller/LiveTv
parentaa96ff42e616ecf5638a8f1e2e8459b94513c528 (diff)
parentd1ab428476f961426841a0561036c59c3b93878e (diff)
Merge branch 'master' into feature/season-provider-id-from-path
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
-rw-r--r--MediaBrowser.Controller/LiveTv/ISchedulesDirectService.cs31
-rw-r--r--MediaBrowser.Controller/LiveTv/ITunerHostManager.cs6
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvChannel.cs2
-rw-r--r--MediaBrowser.Controller/LiveTv/ProgramInfo.cs44
4 files changed, 59 insertions, 24 deletions
diff --git a/MediaBrowser.Controller/LiveTv/ISchedulesDirectService.cs b/MediaBrowser.Controller/LiveTv/ISchedulesDirectService.cs
new file mode 100644
index 0000000000..6953650952
--- /dev/null
+++ b/MediaBrowser.Controller/LiveTv/ISchedulesDirectService.cs
@@ -0,0 +1,31 @@
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Controller.LiveTv;
+
+/// <summary>
+/// Provides Schedules Direct specific operations.
+/// </summary>
+public interface ISchedulesDirectService
+{
+ /// <summary>
+ /// Gets the available countries from the Schedules Direct API, using a file cache.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>A stream containing the raw JSON response.</returns>
+ Task<Stream> GetAvailableCountries(CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets a value indicating whether the Schedules Direct daily image download limit is currently active.
+ /// </summary>
+ /// <returns><c>true</c> if the image limit has been hit and has not yet reset; otherwise <c>false</c>.</returns>
+ bool IsImageDailyLimitActive();
+
+ /// <summary>
+ /// Gets a value indicating whether the Schedules Direct service is available.
+ /// Returns <c>false</c> if a permanent account error has occurred or a transient backoff is active.
+ /// </summary>
+ /// <returns><c>true</c> if the service can accept requests; otherwise <c>false</c>.</returns>
+ bool IsServiceAvailable();
+}
diff --git a/MediaBrowser.Controller/LiveTv/ITunerHostManager.cs b/MediaBrowser.Controller/LiveTv/ITunerHostManager.cs
index 8247066cc9..68e61f3cc4 100644
--- a/MediaBrowser.Controller/LiveTv/ITunerHostManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ITunerHostManager.cs
@@ -38,6 +38,12 @@ public interface ITunerHostManager
IAsyncEnumerable<TunerHostInfo> DiscoverTuners(bool newDevicesOnly);
/// <summary>
+ /// Deletes a tuner host by id, cleans up associated caches, and triggers a guide refresh.
+ /// </summary>
+ /// <param name="id">The tuner host id to delete.</param>
+ void DeleteTunerHost(string? id);
+
+ /// <summary>
/// Scans for tuner devices that have changed URLs.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
index b10e77e10a..aee4691cdf 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs
@@ -109,7 +109,7 @@ namespace MediaBrowser.Controller.LiveTv
{
if (double.TryParse(Number, CultureInfo.InvariantCulture, out double number))
{
- return string.Format(CultureInfo.InvariantCulture, "{0:00000.0}", number) + "-" + (Name ?? string.Empty);
+ return string.Format(CultureInfo.InvariantCulture, "{0:0000000000.00000}", number) + "-" + (Name ?? string.Empty);
}
return (Number ?? string.Empty) + "-" + (Name ?? string.Empty);
diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
index 3c3ac2471f..905aad17b9 100644
--- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
#pragma warning disable CS1591
using System;
@@ -12,45 +10,45 @@ namespace MediaBrowser.Controller.LiveTv
{
public ProgramInfo()
{
- Genres = new List<string>();
+ Genres = [];
- ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ ProviderIds = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
+ SeriesProviderIds = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
}
/// <summary>
/// Gets or sets the id of the program.
/// </summary>
- public string Id { get; set; }
+ public string? Id { get; set; }
/// <summary>
/// Gets or sets the channel identifier.
/// </summary>
/// <value>The channel identifier.</value>
- public string ChannelId { get; set; }
+ public string? ChannelId { get; set; }
/// <summary>
/// Gets or sets the name of the program.
/// </summary>
- public string Name { get; set; }
+ public string? Name { get; set; }
/// <summary>
/// Gets or sets the official rating.
/// </summary>
/// <value>The official rating.</value>
- public string OfficialRating { get; set; }
+ public string? OfficialRating { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <value>The overview.</value>
- public string Overview { get; set; }
+ public string? Overview { get; set; }
/// <summary>
/// Gets or sets the short overview.
/// </summary>
/// <value>The short overview.</value>
- public string ShortOverview { get; set; }
+ public string? ShortOverview { get; set; }
/// <summary>
/// Gets or sets the start date of the program, in UTC.
@@ -108,25 +106,25 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the episode title.
/// </summary>
/// <value>The episode title.</value>
- public string EpisodeTitle { get; set; }
+ public string? EpisodeTitle { get; set; }
/// <summary>
/// Gets or sets the image path if it can be accessed directly from the file system.
/// </summary>
/// <value>The image path.</value>
- public string ImagePath { get; set; }
+ public string? ImagePath { get; set; }
/// <summary>
/// Gets or sets the image url if it can be downloaded.
/// </summary>
/// <value>The image URL.</value>
- public string ImageUrl { get; set; }
+ public string? ImageUrl { get; set; }
- public string ThumbImageUrl { get; set; }
+ public string? ThumbImageUrl { get; set; }
- public string LogoImageUrl { get; set; }
+ public string? LogoImageUrl { get; set; }
- public string BackdropImageUrl { get; set; }
+ public string? BackdropImageUrl { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has image.
@@ -188,19 +186,19 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
- public string HomePageUrl { get; set; }
+ public string? HomePageUrl { get; set; }
/// <summary>
/// Gets or sets the series identifier.
/// </summary>
/// <value>The series identifier.</value>
- public string SeriesId { get; set; }
+ public string? SeriesId { get; set; }
/// <summary>
/// Gets or sets the show identifier.
/// </summary>
/// <value>The show identifier.</value>
- public string ShowId { get; set; }
+ public string? ShowId { get; set; }
/// <summary>
/// Gets or sets the season number.
@@ -218,10 +216,10 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets the etag.
/// </summary>
/// <value>The etag.</value>
- public string Etag { get; set; }
+ public string? Etag { get; set; }
- public Dictionary<string, string> ProviderIds { get; set; }
+ public Dictionary<string, string?> ProviderIds { get; set; }
- public Dictionary<string, string> SeriesProviderIds { get; set; }
+ public Dictionary<string, string?> SeriesProviderIds { get; set; }
}
}