#pragma warning disable CS1591
using System.Net.Http;
using System.Threading.Tasks;
using Emby.Dlna.Service;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ConnectionManager
{
    /// 
    /// Defines the .
    /// 
    public class ConnectionManagerService : BaseService, IConnectionManager
    {
        private readonly IDlnaManager _dlna;
        private readonly IServerConfigurationManager _config;
        /// 
        /// Initializes a new instance of the  class.
        /// 
        /// The  for use with the  instance.
        /// The  for use with the  instance.
        /// The  for use with the  instance..
        /// The  for use with the  instance..
        public ConnectionManagerService(
            IDlnaManager dlna,
            IServerConfigurationManager config,
            ILogger logger,
            IHttpClientFactory httpClientFactory)
            : base(logger, httpClientFactory)
        {
            _dlna = dlna;
            _config = config;
        }
        /// 
        public string GetServiceXml()
        {
            return ConnectionManagerXmlBuilder.GetXml();
        }
        /// 
        public Task ProcessControlRequestAsync(ControlRequest request)
        {
            var profile = _dlna.GetProfile(request.Headers) ??
                         _dlna.GetDefaultProfile();
            return new ControlHandler(_config, Logger, profile).ProcessControlRequestAsync(request);
        }
    }
}