aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ConnectionManager/ConnectionManagerService.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-08-20 21:04:57 +0200
committerBond_009 <bond.009@outlook.com>2020-08-20 21:04:57 +0200
commit170e434f92142a8e4c17d3a5eec0bd9c2d6a0037 (patch)
treee5278ffec73bc8f9bae9b11eecbdeebc89c54c51 /Emby.Dlna/ConnectionManager/ConnectionManagerService.cs
parentac58d07e0e2cf5caa641803f25ad4ecfa997ec51 (diff)
Fix all warnings in Emby.Dlna
Diffstat (limited to 'Emby.Dlna/ConnectionManager/ConnectionManagerService.cs')
-rw-r--r--Emby.Dlna/ConnectionManager/ConnectionManagerService.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Emby.Dlna/ConnectionManager/ConnectionManagerService.cs b/Emby.Dlna/ConnectionManager/ConnectionManagerService.cs
new file mode 100644
index 000000000..12338e2b4
--- /dev/null
+++ b/Emby.Dlna/ConnectionManager/ConnectionManagerService.cs
@@ -0,0 +1,43 @@
+#pragma warning disable CS1591
+
+using System.Threading.Tasks;
+using Emby.Dlna.Service;
+using MediaBrowser.Common.Net;
+using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Controller.Dlna;
+using Microsoft.Extensions.Logging;
+
+namespace Emby.Dlna.ConnectionManager
+{
+ public class ConnectionManagerService : BaseService, IConnectionManager
+ {
+ private readonly IDlnaManager _dlna;
+ private readonly IServerConfigurationManager _config;
+
+ public ConnectionManagerService(
+ IDlnaManager dlna,
+ IServerConfigurationManager config,
+ ILogger<ConnectionManagerService> logger,
+ IHttpClient httpClient)
+ : base(logger, httpClient)
+ {
+ _dlna = dlna;
+ _config = config;
+ }
+
+ /// <inheritdoc />
+ public string GetServiceXml()
+ {
+ return new ConnectionManagerXmlBuilder().GetXml();
+ }
+
+ /// <inheritdoc />
+ public Task<ControlResponse> ProcessControlRequestAsync(ControlRequest request)
+ {
+ var profile = _dlna.GetProfile(request.Headers) ??
+ _dlna.GetDefaultProfile();
+
+ return new ControlHandler(_config, Logger, profile).ProcessControlRequestAsync(request);
+ }
+ }
+}