BaseService.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #nullable disable
  2. #pragma warning disable CS1591
  3. using System.Net.Http;
  4. using Emby.Dlna.Eventing;
  5. using Microsoft.Extensions.Logging;
  6. namespace Emby.Dlna.Service
  7. {
  8. public class BaseService : IDlnaEventManager
  9. {
  10. protected BaseService(ILogger<BaseService> logger, IHttpClientFactory httpClientFactory)
  11. {
  12. Logger = logger;
  13. EventManager = new DlnaEventManager(logger, httpClientFactory);
  14. }
  15. protected IDlnaEventManager EventManager { get; }
  16. protected ILogger Logger { get; }
  17. public EventSubscriptionResponse CancelEventSubscription(string subscriptionId)
  18. {
  19. return EventManager.CancelEventSubscription(subscriptionId);
  20. }
  21. public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl)
  22. {
  23. return EventManager.RenewEventSubscription(subscriptionId, notificationType, requestedTimeoutString, callbackUrl);
  24. }
  25. public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl)
  26. {
  27. return EventManager.CreateEventSubscription(notificationType, requestedTimeoutString, callbackUrl);
  28. }
  29. }
  30. }