diff --git a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs index c28a5618ce..f8ed00aeaf 100644 --- a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs +++ b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.Net; using System.Net.Http; using System.Text; +using Emby.Dlna.ConnectionManager; using Emby.Dlna.ContentDirectory; using Emby.Dlna.Ssdp; using MediaBrowser.Common.Net; @@ -50,5 +51,6 @@ public static class DlnaServiceCollectionExtensions services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); } } diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index b2d2f36986..a22143ae7b 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(); - ConnectionManager = new ConnectionManager.ConnectionManagerService( - dlnaManager, - config, - loggerFactory.CreateLogger(), - httpClientFactory); - MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrarService( loggerFactory.CreateLogger(), httpClientFactory, @@ -122,8 +116,6 @@ namespace Emby.Dlna.Main /// public static bool Enabled { get; private set; } - public IConnectionManager ConnectionManager { get; private set; } - public IMediaReceiverRegistrar MediaReceiverRegistrar { get; private set; } public async Task RunAsync() @@ -433,7 +425,6 @@ namespace Emby.Dlna.Main _communicationsServer = null; } - ConnectionManager = null; MediaReceiverRegistrar = null; Current = null; diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs index 178ba6d6e1..2d52097c04 100644 --- a/Jellyfin.Api/Controllers/DlnaServerController.cs +++ b/Jellyfin.Api/Controllers/DlnaServerController.cs @@ -34,11 +34,15 @@ public class DlnaServerController : BaseJellyfinApiController /// /// Instance of the interface. /// Instance of the interface. - public DlnaServerController(IDlnaManager dlnaManager, IContentDirectory contentDirectory) + /// Instance of the interface. + public DlnaServerController( + IDlnaManager dlnaManager, + IContentDirectory contentDirectory, + IConnectionManager connectionManager) { _dlnaManager = dlnaManager; _contentDirectory = contentDirectory; - _connectionManager = DlnaEntryPoint.Current.ConnectionManager; + _connectionManager = connectionManager; _mediaReceiverRegistrar = DlnaEntryPoint.Current.MediaReceiverRegistrar; }