2020-01-22 20:00:07 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2020-08-31 17:26:42 +00:00
|
|
|
using System.Net.Http;
|
2019-01-13 19:54:44 +00:00
|
|
|
using Emby.Dlna.Eventing;
|
2018-12-13 13:18:25 +00:00
|
|
|
using Microsoft.Extensions.Logging;
|
2016-10-29 22:22:20 +00:00
|
|
|
|
2016-10-29 22:34:54 +00:00
|
|
|
namespace Emby.Dlna.Service
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-13 19:47:31 +00:00
|
|
|
public class BaseService : IDlnaEventManager
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-31 17:26:42 +00:00
|
|
|
protected BaseService(ILogger<BaseService> logger, IHttpClientFactory httpClientFactory)
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
|
|
|
Logger = logger;
|
2020-08-31 17:26:42 +00:00
|
|
|
EventManager = new DlnaEventManager(logger, httpClientFactory);
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
|
2020-08-25 00:04:13 +00:00
|
|
|
protected IDlnaEventManager EventManager { get; }
|
2020-08-20 19:04:57 +00:00
|
|
|
|
|
|
|
protected ILogger Logger { get; }
|
|
|
|
|
2016-10-29 22:22:20 +00:00
|
|
|
public EventSubscriptionResponse CancelEventSubscription(string subscriptionId)
|
|
|
|
{
|
2020-08-20 19:04:57 +00:00
|
|
|
return EventManager.CancelEventSubscription(subscriptionId);
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
|
2017-10-04 18:51:26 +00:00
|
|
|
public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string timeoutString, string callbackUrl)
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-20 19:04:57 +00:00
|
|
|
return EventManager.RenewEventSubscription(subscriptionId, notificationType, timeoutString, callbackUrl);
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
|
2017-07-20 20:37:13 +00:00
|
|
|
public EventSubscriptionResponse CreateEventSubscription(string notificationType, string timeoutString, string callbackUrl)
|
2016-10-29 22:22:20 +00:00
|
|
|
{
|
2020-08-20 19:04:57 +00:00
|
|
|
return EventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl);
|
2016-10-29 22:22:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|