jellyfin/MediaBrowser.Dlna/ConnectionManager/ConnectionManager.cs

38 lines
1.2 KiB
C#
Raw Normal View History

2014-05-20 18:15:46 -07:00
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
2014-05-20 17:56:24 -07:00
using MediaBrowser.Controller.Dlna;
2014-05-20 18:15:46 -07:00
using MediaBrowser.Dlna.Service;
2014-05-20 17:56:24 -07:00
using MediaBrowser.Model.Logging;
using System.Collections.Generic;
namespace MediaBrowser.Dlna.ConnectionManager
{
2014-05-20 18:15:46 -07:00
public class ConnectionManager : BaseService, IConnectionManager
2014-05-20 17:56:24 -07:00
{
private readonly IDlnaManager _dlna;
private readonly ILogger _logger;
private readonly IServerConfigurationManager _config;
2014-05-20 18:15:46 -07:00
public ConnectionManager(IDlnaManager dlna, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient)
: base(logger, httpClient)
2014-05-20 17:56:24 -07:00
{
_dlna = dlna;
_config = config;
2014-05-20 18:15:46 -07:00
_logger = logger;
2014-05-20 17:56:24 -07:00
}
public string GetServiceXml(IDictionary<string, string> headers)
{
return new ConnectionManagerXmlBuilder().GetXml();
}
public ControlResponse ProcessControlRequest(ControlRequest request)
{
var profile = _dlna.GetProfile(request.Headers) ??
_dlna.GetDefaultProfile();
return new ControlHandler(_logger, profile, _config).ProcessControlRequest(request);
}
}
}