jellyfin/Emby.Dlna/ConnectionManager/ConnectionManager.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2019-01-13 19:16:19 +00:00
using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
2016-10-29 22:22:20 +00:00
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using Microsoft.Extensions.Logging;
2016-10-29 22:22:20 +00:00
2016-10-29 22:34:54 +00:00
namespace Emby.Dlna.ConnectionManager
2016-10-29 22:22:20 +00:00
{
public class ConnectionManager : BaseService, IConnectionManager
{
private readonly IDlnaManager _dlna;
private readonly ILogger _logger;
private readonly IServerConfigurationManager _config;
public ConnectionManager(IDlnaManager dlna, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient)
2016-10-29 22:22:20 +00:00
: base(logger, httpClient)
{
_dlna = dlna;
_config = config;
_logger = logger;
}
public string GetServiceXml()
2016-10-29 22:22:20 +00:00
{
return new ConnectionManagerXmlBuilder().GetXml();
}
public ControlResponse ProcessControlRequest(ControlRequest request)
{
var profile = _dlna.GetProfile(request.Headers) ??
_dlna.GetDefaultProfile();
return new ControlHandler(_config, _logger, profile).ProcessControlRequest(request);
2016-10-29 22:22:20 +00:00
}
}
}