diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-30 03:29:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-30 03:29:27 -0400 |
| commit | d31b0f7be4b14e4ada999c97e675b856ad68352b (patch) | |
| tree | a4619513efbb3be62a6204c996526df606cb62c5 /Emby.Dlna/ConnectionManager/ControlHandler.cs | |
| parent | b19f75fcae017cb51f1e58eb2d54ca84620b6ee0 (diff) | |
| parent | 3094cd7ff3e51578808ce1b6f56b141930c18004 (diff) | |
Merge pull request #2258 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Dlna/ConnectionManager/ControlHandler.cs')
| -rw-r--r-- | Emby.Dlna/ConnectionManager/ControlHandler.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Emby.Dlna/ConnectionManager/ControlHandler.cs b/Emby.Dlna/ConnectionManager/ControlHandler.cs new file mode 100644 index 0000000000..e9af5cd1de --- /dev/null +++ b/Emby.Dlna/ConnectionManager/ControlHandler.cs @@ -0,0 +1,41 @@ +using MediaBrowser.Common.Extensions; +using MediaBrowser.Controller.Configuration; +using Emby.Dlna.Server; +using Emby.Dlna.Service; +using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Logging; +using System; +using System.Collections.Generic; + +namespace Emby.Dlna.ConnectionManager +{ + public class ControlHandler : BaseControlHandler + { + private readonly DeviceProfile _profile; + + public ControlHandler(ILogger logger, DeviceProfile profile, IServerConfigurationManager config) + : base(config, logger) + { + _profile = profile; + } + + protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, Headers methodParams) + { + if (string.Equals(methodName, "GetProtocolInfo", StringComparison.OrdinalIgnoreCase)) + { + return HandleGetProtocolInfo(); + } + + throw new ResourceNotFoundException("Unexpected control request name: " + methodName); + } + + private IEnumerable<KeyValuePair<string, string>> HandleGetProtocolInfo() + { + return new Headers(true) + { + { "Source", _profile.ProtocolInfo }, + { "Sink", "" } + }; + } + } +} |
