jellyfin/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrarService.cs

47 lines
1.8 KiB
C#
Raw Normal View History

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-09-13 13:36:10 +00:00
/// <summary>
/// Defines the <see cref="MediaReceiverRegistrarService" />.
/// </summary>
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-09-13 13:36:10 +00: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 19:04:57 +00:00
public MediaReceiverRegistrarService(
ILogger<MediaReceiverRegistrarService> logger,
IHttpClientFactory httpClientFactory,
IServerConfigurationManager config)
: base(logger, httpClientFactory)
2016-10-29 22:22:20 +00:00
{
_config = config;
}
2020-01-21 16:59:41 +00:00
/// <inheritdoc />
public string GetServiceXml()
2016-10-29 22:22:20 +00:00
{
2020-09-13 13:36:10 +00:00
return MediaReceiverRegistrarXmlBuilder.GetXml();
2016-10-29 22:22:20 +00:00
}
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,
Logger)
2020-01-21 16:59:41 +00:00
.ProcessControlRequestAsync(request);
2016-10-29 22:22:20 +00:00
}
}
}