diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-08-20 21:04:57 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-08-20 21:04:57 +0200 |
| commit | 170e434f92142a8e4c17d3a5eec0bd9c2d6a0037 (patch) | |
| tree | e5278ffec73bc8f9bae9b11eecbdeebc89c54c51 /Emby.Dlna/Service | |
| parent | ac58d07e0e2cf5caa641803f25ad4ecfa997ec51 (diff) | |
Fix all warnings in Emby.Dlna
Diffstat (limited to 'Emby.Dlna/Service')
| -rw-r--r-- | Emby.Dlna/Service/BaseControlHandler.cs | 18 | ||||
| -rw-r--r-- | Emby.Dlna/Service/BaseService.cs | 20 | ||||
| -rw-r--r-- | Emby.Dlna/Service/ServiceXmlBuilder.cs | 2 |
3 files changed, 21 insertions, 19 deletions
diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.cs index 91a21a21d..d160e3339 100644 --- a/Emby.Dlna/Service/BaseControlHandler.cs +++ b/Emby.Dlna/Service/BaseControlHandler.cs @@ -210,15 +210,6 @@ namespace Emby.Dlna.Service } } - private class ControlRequestInfo - { - public string LocalName { get; set; } - - public string NamespaceURI { get; set; } - - public Dictionary<string, string> Headers { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); - } - protected abstract void WriteResult(string methodName, IDictionary<string, string> methodParams, XmlWriter xmlWriter); private void LogRequest(ControlRequest request) @@ -240,5 +231,14 @@ namespace Emby.Dlna.Service Logger.LogDebug("Control response. Headers: {@Headers}\n{Xml}", response.Headers, response.Xml); } + + private class ControlRequestInfo + { + public string LocalName { get; set; } + + public string NamespaceURI { get; set; } + + public Dictionary<string, string> Headers { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + } } } diff --git a/Emby.Dlna/Service/BaseService.cs b/Emby.Dlna/Service/BaseService.cs index 88c62f86c..3ad1ea9e0 100644 --- a/Emby.Dlna/Service/BaseService.cs +++ b/Emby.Dlna/Service/BaseService.cs @@ -8,31 +8,33 @@ namespace Emby.Dlna.Service { public class BaseService : IEventManager { - protected IEventManager _eventManager; - protected IHttpClient _httpClient; - protected ILogger Logger; - protected BaseService(ILogger<BaseService> logger, IHttpClient httpClient) { Logger = logger; - _httpClient = httpClient; + HttpClient = httpClient; - _eventManager = new EventManager(logger, _httpClient); + EventManager = new EventManager(logger, HttpClient); } + protected IEventManager EventManager { get; } + + protected IHttpClient HttpClient { get; } + + protected ILogger Logger { get; } + public EventSubscriptionResponse CancelEventSubscription(string subscriptionId) { - return _eventManager.CancelEventSubscription(subscriptionId); + return EventManager.CancelEventSubscription(subscriptionId); } public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string timeoutString, string callbackUrl) { - return _eventManager.RenewEventSubscription(subscriptionId, notificationType, timeoutString, callbackUrl); + return EventManager.RenewEventSubscription(subscriptionId, notificationType, timeoutString, callbackUrl); } public EventSubscriptionResponse CreateEventSubscription(string notificationType, string timeoutString, string callbackUrl) { - return _eventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl); + return EventManager.CreateEventSubscription(notificationType, timeoutString, callbackUrl); } } } diff --git a/Emby.Dlna/Service/ServiceXmlBuilder.cs b/Emby.Dlna/Service/ServiceXmlBuilder.cs index 6c7d6f846..1e56d09b2 100644 --- a/Emby.Dlna/Service/ServiceXmlBuilder.cs +++ b/Emby.Dlna/Service/ServiceXmlBuilder.cs @@ -87,7 +87,7 @@ namespace Emby.Dlna.Service .Append(SecurityElement.Escape(item.DataType ?? string.Empty)) .Append("</dataType>"); - if (item.AllowedValues.Length > 0) + if (item.AllowedValues.Count > 0) { builder.Append("<allowedValueList>"); foreach (var allowedValue in item.AllowedValues) |
