From cac7ff84ca407d7f452f1ea988f472118012f6da Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Wed, 21 Feb 2024 11:12:49 -0500 Subject: [PATCH] Rename EmbyTV to DefaultLiveTvService --- Jellyfin.Server/Startup.cs | 1 - .../{EmbyTV/EmbyTV.cs => DefaultLiveTvService.cs} | 10 +++++----- .../Extensions/LiveTvServiceCollectionExtensions.cs | 2 +- src/Jellyfin.LiveTv/Guide/GuideManager.cs | 2 +- src/Jellyfin.LiveTv/LiveTvManager.cs | 10 +++++----- src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs | 1 - .../Recordings/RecordingsMetadataManager.cs | 1 - 7 files changed, 12 insertions(+), 15 deletions(-) rename src/Jellyfin.LiveTv/{EmbyTV/EmbyTV.cs => DefaultLiveTvService.cs} (99%) diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 6728cd0b4..e9fb3e4c2 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -6,7 +6,6 @@ using System.Net.Mime; using System.Text; using Emby.Server.Implementations.EntryPoints; using Jellyfin.Api.Middleware; -using Jellyfin.LiveTv.EmbyTV; using Jellyfin.LiveTv.Extensions; using Jellyfin.LiveTv.Recordings; using Jellyfin.MediaEncoding.Hls.Extensions; diff --git a/src/Jellyfin.LiveTv/EmbyTV/EmbyTV.cs b/src/Jellyfin.LiveTv/DefaultLiveTvService.cs similarity index 99% rename from src/Jellyfin.LiveTv/EmbyTV/EmbyTV.cs rename to src/Jellyfin.LiveTv/DefaultLiveTvService.cs index 06a0ea4e9..318cc7acd 100644 --- a/src/Jellyfin.LiveTv/EmbyTV/EmbyTV.cs +++ b/src/Jellyfin.LiveTv/DefaultLiveTvService.cs @@ -24,13 +24,13 @@ using MediaBrowser.Model.Dto; using MediaBrowser.Model.LiveTv; using Microsoft.Extensions.Logging; -namespace Jellyfin.LiveTv.EmbyTV +namespace Jellyfin.LiveTv { - public sealed class EmbyTV : ILiveTvService, ISupportsDirectStreamProvider, ISupportsNewTimerIds + public sealed class DefaultLiveTvService : ILiveTvService, ISupportsDirectStreamProvider, ISupportsNewTimerIds { public const string ServiceName = "Emby"; - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly IServerConfigurationManager _config; private readonly ITunerHostManager _tunerHostManager; private readonly IListingsManager _listingsManager; @@ -40,8 +40,8 @@ namespace Jellyfin.LiveTv.EmbyTV private readonly TimerManager _timerManager; private readonly SeriesTimerManager _seriesTimerManager; - public EmbyTV( - ILogger logger, + public DefaultLiveTvService( + ILogger logger, IServerConfigurationManager config, ITunerHostManager tunerHostManager, IListingsManager listingsManager, diff --git a/src/Jellyfin.LiveTv/Extensions/LiveTvServiceCollectionExtensions.cs b/src/Jellyfin.LiveTv/Extensions/LiveTvServiceCollectionExtensions.cs index e247ecb44..73729c950 100644 --- a/src/Jellyfin.LiveTv/Extensions/LiveTvServiceCollectionExtensions.cs +++ b/src/Jellyfin.LiveTv/Extensions/LiveTvServiceCollectionExtensions.cs @@ -37,7 +37,7 @@ public static class LiveTvServiceCollectionExtensions services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Jellyfin.LiveTv/Guide/GuideManager.cs b/src/Jellyfin.LiveTv/Guide/GuideManager.cs index 056bb6e6d..39f174cc2 100644 --- a/src/Jellyfin.LiveTv/Guide/GuideManager.cs +++ b/src/Jellyfin.LiveTv/Guide/GuideManager.cs @@ -141,7 +141,7 @@ public class GuideManager : IGuideManager CleanDatabase(newProgramIdList.ToArray(), [BaseItemKind.LiveTvProgram], progress, cancellationToken); } - var coreService = _liveTvManager.Services.OfType().FirstOrDefault(); + var coreService = _liveTvManager.Services.OfType().FirstOrDefault(); if (coreService is not null) { await coreService.RefreshSeriesTimers(cancellationToken).ConfigureAwait(false); diff --git a/src/Jellyfin.LiveTv/LiveTvManager.cs b/src/Jellyfin.LiveTv/LiveTvManager.cs index f7b9604af..0af40a059 100644 --- a/src/Jellyfin.LiveTv/LiveTvManager.cs +++ b/src/Jellyfin.LiveTv/LiveTvManager.cs @@ -72,7 +72,7 @@ namespace Jellyfin.LiveTv _recordingsManager = recordingsManager; _services = services.ToArray(); - var defaultService = _services.OfType().First(); + var defaultService = _services.OfType().First(); defaultService.TimerCreated += OnEmbyTvTimerCreated; defaultService.TimerCancelled += OnEmbyTvTimerCancelled; } @@ -340,7 +340,7 @@ namespace Jellyfin.LiveTv // Set the total bitrate if not already supplied mediaSource.InferTotalBitrate(); - if (service is not EmbyTV.EmbyTV) + if (service is not DefaultLiveTvService) { // We can't trust that we'll be able to direct stream it through emby server, no matter what the provider says // mediaSource.SupportsDirectPlay = false; @@ -769,7 +769,7 @@ namespace Jellyfin.LiveTv var channel = string.IsNullOrWhiteSpace(info.ChannelId) ? null - : _libraryManager.GetItemById(_tvDtoService.GetInternalChannelId(EmbyTV.EmbyTV.ServiceName, info.ChannelId)); + : _libraryManager.GetItemById(_tvDtoService.GetInternalChannelId(DefaultLiveTvService.ServiceName, info.ChannelId)); dto.SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null @@ -1005,7 +1005,7 @@ namespace Jellyfin.LiveTv await service.CancelTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false); - if (service is not EmbyTV.EmbyTV) + if (service is not DefaultLiveTvService) { TimerCancelled?.Invoke(this, new GenericEventArgs(new TimerEventInfo(id))); } @@ -1314,7 +1314,7 @@ namespace Jellyfin.LiveTv _logger.LogInformation("New recording scheduled"); - if (service is not EmbyTV.EmbyTV) + if (service is not DefaultLiveTvService) { TimerCreated?.Invoke(this, new GenericEventArgs( new TimerEventInfo(newTimerId) diff --git a/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs b/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs index 20f89ec8f..92605a1eb 100644 --- a/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs +++ b/src/Jellyfin.LiveTv/Recordings/RecordingsManager.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using AsyncKeyedLock; using Jellyfin.Data.Enums; using Jellyfin.LiveTv.Configuration; -using Jellyfin.LiveTv.EmbyTV; using Jellyfin.LiveTv.IO; using Jellyfin.LiveTv.Timers; using MediaBrowser.Common.Configuration; diff --git a/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs b/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs index 0a71a4d46..b2b82332d 100644 --- a/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs +++ b/src/Jellyfin.LiveTv/Recordings/RecordingsMetadataManager.cs @@ -9,7 +9,6 @@ using System.Xml; using Jellyfin.Data.Enums; using Jellyfin.Extensions; using Jellyfin.LiveTv.Configuration; -using Jellyfin.LiveTv.EmbyTV; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Dto;