diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-06-16 19:02:16 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-16 19:02:16 +0900 |
| commit | 215ab39e00be3a79875351a76f0d836a9281ce6b (patch) | |
| tree | f63be424fafa6588cd1b640119ef33aef7954adb | |
| parent | 2bdea29e2560a79a3621e72665bcdd00ec1ad769 (diff) | |
| parent | 6d6793151a47776b1f535fa2ceeda370ea6d7b40 (diff) | |
Merge pull request #3342 from BaronGreenback/BugFix2
Fix for [DLNA] Many log messages from Media Renderers trying to see old events
| -rw-r--r-- | Emby.Dlna/Eventing/EventManager.cs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.cs index edccfd190..56c90c8b3 100644 --- a/Emby.Dlna/Eventing/EventManager.cs +++ b/Emby.Dlna/Eventing/EventManager.cs @@ -31,18 +31,26 @@ namespace Emby.Dlna.Eventing public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl) { var subscription = GetSubscription(subscriptionId, false); + if (subscription != null) + { + subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300; + int timeoutSeconds = subscription.TimeoutSeconds; + subscription.SubscriptionTime = DateTime.UtcNow; - subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300; - int timeoutSeconds = subscription.TimeoutSeconds; - subscription.SubscriptionTime = DateTime.UtcNow; + _logger.LogDebug( + "Renewing event subscription for {0} with timeout of {1} to {2}", + subscription.NotificationType, + timeoutSeconds, + subscription.CallbackUrl); - _logger.LogDebug( - "Renewing event subscription for {0} with timeout of {1} to {2}", - subscription.NotificationType, - timeoutSeconds, - subscription.CallbackUrl); + return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, timeoutSeconds); + } - return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, timeoutSeconds); + return new EventSubscriptionResponse + { + Content = string.Empty, + ContentType = "text/plain" + }; } public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl) |
