diff options
Diffstat (limited to 'Emby.Dlna/Eventing/EventManager.cs')
| -rw-r--r-- | Emby.Dlna/Eventing/EventManager.cs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Emby.Dlna/Eventing/EventManager.cs b/Emby.Dlna/Eventing/EventManager.cs index ea9ba3f22..b4ff3ec1d 100644 --- a/Emby.Dlna/Eventing/EventManager.cs +++ b/Emby.Dlna/Eventing/EventManager.cs @@ -1,7 +1,3 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Dlna; -using Microsoft.Extensions.Logging; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -9,6 +5,9 @@ using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; +using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Net; +using Microsoft.Extensions.Logging; namespace Emby.Dlna.Eventing { @@ -83,9 +82,7 @@ namespace Emby.Dlna.Eventing // Starts with SECOND- header = header.Split('-').Last(); - int val; - - if (int.TryParse(header, NumberStyles.Integer, _usCulture, out val)) + if (int.TryParse(header, NumberStyles.Integer, _usCulture, out var val)) { return val; } @@ -98,8 +95,7 @@ namespace Emby.Dlna.Eventing { _logger.LogDebug("Cancelling event subscription {0}", subscriptionId); - EventSubscription sub; - _subscriptions.TryRemove(subscriptionId, out sub); + _subscriptions.TryRemove(subscriptionId, out EventSubscription sub); return new EventSubscriptionResponse { @@ -130,9 +126,7 @@ namespace Emby.Dlna.Eventing private EventSubscription GetSubscription(string id, bool throwOnMissing) { - EventSubscription e; - - if (!_subscriptions.TryGetValue(id, out e) && throwOnMissing) + if (!_subscriptions.TryGetValue(id, out EventSubscription e) && throwOnMissing) { throw new ResourceNotFoundException("Event with Id " + id + " not found."); } |
