aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ConnectionManager/ControlHandler.cs
diff options
context:
space:
mode:
authorPeter Maar <alset333@icloud.com>2020-03-19 22:02:08 -0400
committerGitHub <noreply@github.com>2020-03-19 22:02:08 -0400
commitadbf375efe44a5866a277ff2d7720c0ced6597b2 (patch)
treee89e50745ed8288b7bbd388018ed7669e449fee9 /Emby.Dlna/ConnectionManager/ControlHandler.cs
parent818695a01e007ce507d4518aefc520870989964d (diff)
parentaf5d3e8eaeea6cd1c2e9248352a2e728d27b3c22 (diff)
Merge pull request #1 from jellyfin/master
Pull latest to my fork
Diffstat (limited to 'Emby.Dlna/ConnectionManager/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ConnectionManager/ControlHandler.cs30
1 files changed, 16 insertions, 14 deletions
diff --git a/Emby.Dlna/ConnectionManager/ControlHandler.cs b/Emby.Dlna/ConnectionManager/ControlHandler.cs
index 2e1104748..d4cc65394 100644
--- a/Emby.Dlna/ConnectionManager/ControlHandler.cs
+++ b/Emby.Dlna/ConnectionManager/ControlHandler.cs
@@ -1,5 +1,8 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
+using System.Xml;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
@@ -12,29 +15,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);
}
}
}