aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ConnectionManager/ControlHandler.cs
diff options
context:
space:
mode:
authorartiume <siderite@gmail.com>2020-02-13 05:53:23 -0500
committerGitHub <noreply@github.com>2020-02-13 05:53:23 -0500
commit40ad6f843fddab81bdaf26af4e6530ce4529eebf (patch)
tree901eda2816373cc569ca0d3b1bca12418fb1f679 /Emby.Dlna/ConnectionManager/ControlHandler.cs
parentfd55164410f2cc630390e0694f8b962fce96aa61 (diff)
parent64800de29da43aa74c2925d2a10b1f626b8c2eae (diff)
Merge pull request #16 from jellyfin/master
nightly
Diffstat (limited to 'Emby.Dlna/ConnectionManager/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ConnectionManager/ControlHandler.cs31
1 files changed, 17 insertions, 14 deletions
diff --git a/Emby.Dlna/ConnectionManager/ControlHandler.cs b/Emby.Dlna/ConnectionManager/ControlHandler.cs
index 2e1104748..b390515b8 100644
--- a/Emby.Dlna/ConnectionManager/ControlHandler.cs
+++ b/Emby.Dlna/ConnectionManager/ControlHandler.cs
@@ -1,5 +1,9 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1600
+
using System;
using System.Collections.Generic;
+using System.Xml;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
@@ -12,29 +16,28 @@ namespace Emby.Dlna.ConnectionManager
{
private readonly DeviceProfile _profile;
- protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, IDictionary<string, string> methodParams)
+ public ControlHandler(IServerConfigurationManager config, ILogger logger, DeviceProfile profile)
+ : base(config, logger)
+ {
+ _profile = profile;
+ }
+
+ /// <inheritdoc />
+ protected override void WriteResult(string methodName, IDictionary<string, string> methodParams, XmlWriter xmlWriter)
{
if (string.Equals(methodName, "GetProtocolInfo", StringComparison.OrdinalIgnoreCase))
{
- return HandleGetProtocolInfo();
+ HandleGetProtocolInfo(xmlWriter);
+ return;
}
throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
}
- private IEnumerable<KeyValuePair<string, string>> HandleGetProtocolInfo()
+ private void HandleGetProtocolInfo(XmlWriter xmlWriter)
{
- return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
- {
- { "Source", _profile.ProtocolInfo },
- { "Sink", "" }
- };
- }
-
- public ControlHandler(IServerConfigurationManager config, ILogger logger, DeviceProfile profile)
- : base(config, logger)
- {
- _profile = profile;
+ xmlWriter.WriteElementString("Source", _profile.ProtocolInfo);
+ xmlWriter.WriteElementString("Sink", string.Empty);
}
}
}