diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-10-24 01:20:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-24 01:20:09 -0400 |
| commit | 0aac8045fb69ad1024859812a09e68070ea698f6 (patch) | |
| tree | 6e8b55133b0eeee606df5049497b80a612843733 /Emby.Dlna/Eventing/EventManager.cs | |
| parent | 7924bb7c9add449f61d8695add6f2f3fcbc18a0a (diff) | |
| parent | 6c5f3ce07e8b36299a4143dc609999d880e7bdfd (diff) | |
Merge pull request #2974 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Dlna/Eventing/EventManager.cs')
| -rw-r--r-- | Emby.Dlna/Eventing/EventManager.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.cs index 0516585ae..67eac640e 100644 --- a/Emby.Dlna/Eventing/EventManager.cs +++ b/Emby.Dlna/Eventing/EventManager.cs @@ -26,9 +26,11 @@ namespace Emby.Dlna.Eventing _logger = logger; } - public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string requestedTimeoutString) + public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl) { - var subscription = GetSubscription(subscriptionId, true); + var subscription = GetSubscription(subscriptionId, false); + + int timeoutSeconds; // Remove logging for now because some devices are sending this very frequently // TODO re-enable with dlna debug logging setting @@ -37,10 +39,18 @@ namespace Emby.Dlna.Eventing // timeout, // subscription.CallbackUrl); - subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300; - subscription.SubscriptionTime = DateTime.UtcNow; + if (subscription != null) + { + subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300; + timeoutSeconds = subscription.TimeoutSeconds; + subscription.SubscriptionTime = DateTime.UtcNow; + } + else + { + timeoutSeconds = 300; + } - return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, subscription.TimeoutSeconds); + return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, timeoutSeconds); } public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl) @@ -172,7 +182,10 @@ namespace Emby.Dlna.Eventing try { - await _httpClient.SendAsync(options, "NOTIFY").ConfigureAwait(false); + using (await _httpClient.SendAsync(options, "NOTIFY").ConfigureAwait(false)) + { + + } } catch (OperationCanceledException) { |
