jellyfin/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarService.cs

47 lines
1.8 KiB
C#
Raw Normal View History

using System.Net.Http;
2020-01-21 09:59:41 -07:00
using System.Threading.Tasks;
2016-10-29 15:34:54 -07:00
using Emby.Dlna.Service;
2019-01-13 12:16:19 -07:00
using MediaBrowser.Controller.Configuration;
using Microsoft.Extensions.Logging;
2016-10-29 15:22:20 -07:00
2016-10-29 15:34:54 -07:00
namespace Emby.Dlna.MediaReceiverRegistrar
2016-10-29 15:22:20 -07:00
{
2020-09-13 06:36:10 -07:00
/// <summary>
/// Defines the <see cref="MediaReceiverRegistrarService" />.
/// </summary>
2020-08-20 12:04:57 -07:00
public class MediaReceiverRegistrarService : BaseService, IMediaReceiverRegistrar
2016-10-29 15:22:20 -07:00
{
private readonly IServerConfigurationManager _config;
2020-09-13 06:36:10 -07:00
/// <summary>
/// Initializes a new instance of the <see cref="MediaReceiverRegistrarService"/> class.
/// </summary>
/// <param name="logger">The <see cref="ILogger{MediaReceiverRegistrarService}"/> for use with the <see cref="MediaReceiverRegistrarService"/> instance.</param>
/// <param name="httpClientFactory">The <see cref="IHttpClientFactory"/> for use with the <see cref="MediaReceiverRegistrarService"/> instance.</param>
/// <param name="config">The <see cref="IServerConfigurationManager"/> for use with the <see cref="MediaReceiverRegistrarService"/> instance.</param>
2020-08-20 12:04:57 -07:00
public MediaReceiverRegistrarService(
ILogger<MediaReceiverRegistrarService> logger,
IHttpClientFactory httpClientFactory,
IServerConfigurationManager config)
: base(logger, httpClientFactory)
2016-10-29 15:22:20 -07:00
{
_config = config;
}
2020-01-21 09:59:41 -07:00
/// <inheritdoc />
public string GetServiceXml()
2016-10-29 15:22:20 -07:00
{
2020-09-13 06:36:10 -07:00
return MediaReceiverRegistrarXmlBuilder.GetXml();
2016-10-29 15:22:20 -07:00
}
2020-01-21 09:59:41 -07:00
/// <inheritdoc />
public Task<ControlResponse> ProcessControlRequestAsync(ControlRequest request)
2016-10-29 15:22:20 -07:00
{
return new ControlHandler(
_config,
Logger)
2020-01-21 09:59:41 -07:00
.ProcessControlRequestAsync(request);
2016-10-29 15:22:20 -07:00
}
}
}