diff options
| author | Patrick Barron <barronpm@gmail.com> | 2023-10-11 11:12:33 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2023-10-11 11:12:33 -0400 |
| commit | 010cf2340aca8f21d90fd9c8c8653b9b8d7208b2 (patch) | |
| tree | ffcde99f2a97ccf7627cda9ca44461a40391d3be /Emby.Dlna | |
| parent | e0b089a37573a02898e179e738d44039df9432bf (diff) | |
Use DI for MediaReceiverRegistrarService
Diffstat (limited to 'Emby.Dlna')
| -rw-r--r-- | Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs | 2 | ||||
| -rw-r--r-- | Emby.Dlna/Main/DlnaEntryPoint.cs | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs index f8ed00aeaf..8361cc7e78 100644 --- a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs +++ b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs @@ -5,6 +5,7 @@ using System.Net.Http; using System.Text; using Emby.Dlna.ConnectionManager; using Emby.Dlna.ContentDirectory; +using Emby.Dlna.MediaReceiverRegistrar; using Emby.Dlna.Ssdp; using MediaBrowser.Common.Net; using MediaBrowser.Controller; @@ -52,5 +53,6 @@ public static class DlnaServiceCollectionExtensions services.AddSingleton<IDeviceDiscovery, DeviceDiscovery>(); services.AddSingleton<IContentDirectory, ContentDirectoryService>(); services.AddSingleton<IConnectionManager, ConnectionManagerService>(); + services.AddSingleton<IMediaReceiverRegistrar, MediaReceiverRegistrarService>(); } } diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index a22143ae7b..ea996a4424 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -94,12 +94,6 @@ namespace Emby.Dlna.Main _networkManager = networkManager; _logger = loggerFactory.CreateLogger<DlnaEntryPoint>(); - MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrarService( - loggerFactory.CreateLogger<MediaReceiverRegistrar.MediaReceiverRegistrarService>(), - httpClientFactory, - config); - Current = this; - var netConfig = config.GetConfiguration<NetworkConfiguration>(NetworkConfigurationStore.StoreKey); _disabled = appHost.ListenWithHttps && netConfig.RequireHttps; @@ -109,15 +103,11 @@ namespace Emby.Dlna.Main } } - public static DlnaEntryPoint Current { get; private set; } - /// <summary> /// Gets a value indicating whether the dlna server is enabled. /// </summary> public static bool Enabled { get; private set; } - public IMediaReceiverRegistrar MediaReceiverRegistrar { get; private set; } - public async Task RunAsync() { await ((DlnaManager)_dlnaManager).InitProfilesAsync().ConfigureAwait(false); @@ -425,9 +415,6 @@ namespace Emby.Dlna.Main _communicationsServer = null; } - MediaReceiverRegistrar = null; - Current = null; - _disposed = true; } } |
