diff --git a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs index 3a47acf10a..c28a5618ce 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.ContentDirectory; using Emby.Dlna.Ssdp; using MediaBrowser.Common.Net; using MediaBrowser.Controller; @@ -48,5 +49,6 @@ public static class DlnaServiceCollectionExtensions services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); } } diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index 83b0ef3164..b2d2f36986 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -23,7 +23,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Session; -using MediaBrowser.Controller.TV; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Net; @@ -76,9 +75,7 @@ namespace Emby.Dlna.Main IDeviceDiscovery deviceDiscovery, IMediaEncoder mediaEncoder, ISocketFactory socketFactory, - INetworkManager networkManager, - IUserViewManager userViewManager, - ITVSeriesManager tvSeriesManager) + INetworkManager networkManager) { _config = config; _appHost = appHost; @@ -97,21 +94,6 @@ namespace Emby.Dlna.Main _networkManager = networkManager; _logger = loggerFactory.CreateLogger(); - ContentDirectory = new ContentDirectory.ContentDirectoryService( - dlnaManager, - userDataManager, - imageProcessor, - libraryManager, - config, - userManager, - loggerFactory.CreateLogger(), - httpClientFactory, - localizationManager, - mediaSourceManager, - userViewManager, - mediaEncoder, - tvSeriesManager); - ConnectionManager = new ConnectionManager.ConnectionManagerService( dlnaManager, config, @@ -140,8 +122,6 @@ namespace Emby.Dlna.Main /// public static bool Enabled { get; private set; } - public IContentDirectory ContentDirectory { get; private set; } - public IConnectionManager ConnectionManager { get; private set; } public IMediaReceiverRegistrar MediaReceiverRegistrar { get; private set; } @@ -453,7 +433,6 @@ namespace Emby.Dlna.Main _communicationsServer = null; } - ContentDirectory = null; ConnectionManager = null; MediaReceiverRegistrar = null; Current = null; diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs index 95b296fae9..178ba6d6e1 100644 --- a/Jellyfin.Api/Controllers/DlnaServerController.cs +++ b/Jellyfin.Api/Controllers/DlnaServerController.cs @@ -33,10 +33,11 @@ public class DlnaServerController : BaseJellyfinApiController /// Initializes a new instance of the class. /// /// Instance of the interface. - public DlnaServerController(IDlnaManager dlnaManager) + /// Instance of the interface. + public DlnaServerController(IDlnaManager dlnaManager, IContentDirectory contentDirectory) { _dlnaManager = dlnaManager; - _contentDirectory = DlnaEntryPoint.Current.ContentDirectory; + _contentDirectory = contentDirectory; _connectionManager = DlnaEntryPoint.Current.ConnectionManager; _mediaReceiverRegistrar = DlnaEntryPoint.Current.MediaReceiverRegistrar; }