BaseService.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Controller.Dlna;
  3. using Emby.Dlna.Eventing;
  4. using MediaBrowser.Model.Logging;
  5. namespace Emby.Dlna.Service
  6. {
  7. public class BaseService : IEventManager
  8. {
  9. protected IEventManager EventManager;
  10. protected IHttpClient HttpClient;
  11. protected ILogger Logger;
  12. protected BaseService(ILogger logger, IHttpClient httpClient)
  13. {
  14. Logger = logger;
  15. HttpClient = httpClient;
  16. EventManager = new EventManager(Logger, HttpClient);
  17. }
  18. public EventSubscriptionResponse CancelEventSubscription(string subscriptionId)
  19. {
  20. return EventManager.CancelEventSubscription(subscriptionId);
  21. }
  22. public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, int? timeoutSeconds)
  23. {
  24. return EventManager.RenewEventSubscription(subscriptionId, timeoutSeconds);
  25. }
  26. public EventSubscriptionResponse CreateEventSubscription(string notificationType, int? timeoutSeconds, string callbackUrl)
  27. {
  28. return EventManager.CreateEventSubscription(notificationType, timeoutSeconds, callbackUrl);
  29. }
  30. }
  31. }