BaseService.cs 1.3 KB

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