aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2023-10-11 13:35:51 -0400
committerPatrick Barron <barronpm@gmail.com>2023-10-11 13:35:51 -0400
commit44380933a0091cba642715395d1b1edd64889120 (patch)
tree2c848a1431112bca9922c9d66c0150d8bca7c56f /Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs
parentf0618ce33531dfdcb8d70dc46de309d66903b54e (diff)
Use DI for SsdpCommunicationsServer
Diffstat (limited to 'Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs')
-rw-r--r--Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs
index 8361cc7e78..32f58cade1 100644
--- a/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs
+++ b/Emby.Dlna/Extensions/DlnaServiceCollectionExtensions.cs
@@ -11,7 +11,10 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Net;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Rssdp.Infrastructure;
namespace Emby.Dlna.Extensions;
@@ -54,5 +57,13 @@ public static class DlnaServiceCollectionExtensions
services.AddSingleton<IContentDirectory, ContentDirectoryService>();
services.AddSingleton<IConnectionManager, ConnectionManagerService>();
services.AddSingleton<IMediaReceiverRegistrar, MediaReceiverRegistrarService>();
+
+ services.AddSingleton<ISsdpCommunicationsServer>(provider => new SsdpCommunicationsServer(
+ provider.GetRequiredService<ISocketFactory>(),
+ provider.GetRequiredService<INetworkManager>(),
+ provider.GetRequiredService<ILogger<SsdpCommunicationsServer>>())
+ {
+ IsShared = true
+ });
}
}