2020-01-22 20:00:07 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2020-08-31 17:26:42 +00:00
|
|
|
using System.Net.Http;
|
2020-01-21 16:59:41 +00:00
|
|
|
using System.Threading.Tasks;
|
2016-10-29 22:34:54 +00:00
|
|
|
using Emby.Dlna.Service;
|
2019-01-13 19:16:19 +00:00
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
using Microsoft.Extensions.Logging;
|
2016-10-29 22:22:20 +00:00
|
|
|
|
2016-10-29 22:34:54 +00:00
|
|
|
namespace Emby.Dlna.MediaReceiverRegistrar
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-20 19:04:57 +00:00
|
|
|
public class MediaReceiverRegistrarService : BaseService, IMediaReceiverRegistrar
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
private readonly IServerConfigurationManager _config;
|
|
|
|
|
2020-08-20 19:04:57 +00:00
|
|
|
public MediaReceiverRegistrarService(
|
|
|
|
ILogger<MediaReceiverRegistrarService> logger,
|
2020-08-31 17:26:42 +00:00
|
|
|
IHttpClientFactory httpClientFactory,
|
2020-03-03 22:07:10 +00:00
|
|
|
IServerConfigurationManager config)
|
2020-08-31 17:26:42 +00:00
|
|
|
: base(logger, httpClientFactory)
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
_config = config;
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:59:41 +00:00
|
|
|
/// <inheritdoc />
|
2019-02-27 13:23:39 +00:00
|
|
|
public string GetServiceXml()
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
return new MediaReceiverRegistrarXmlBuilder().GetXml();
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:59:41 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public Task<ControlResponse> ProcessControlRequestAsync(ControlRequest request)
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
return new ControlHandler(
|
|
|
|
_config,
|
2019-02-01 16:43:31 +00:00
|
|
|
Logger)
|
2020-01-21 16:59:41 +00:00
|
|
|
.ProcessControlRequestAsync(request);
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|