Răsfoiți Sursa

Code review

David 4 ani în urmă
părinte
comite
1337a0dcec

+ 3 - 3
Emby.Dlna/Didl/StringWriterWithEncoding.cs

@@ -1,7 +1,7 @@
 #pragma warning disable CS1591
+#pragma warning disable CA1305
 
 using System;
-using System.Globalization;
 using System.IO;
 using System.Text;
 
@@ -21,7 +21,7 @@ namespace Emby.Dlna.Didl
         }
 
         public StringWriterWithEncoding(StringBuilder sb)
-            : base(sb, CultureInfo.InvariantCulture)
+            : base(sb)
         {
         }
 
@@ -42,7 +42,7 @@ namespace Emby.Dlna.Didl
         }
 
         public StringWriterWithEncoding(StringBuilder sb, Encoding encoding)
-            : base(sb, CultureInfo.InvariantCulture)
+            : base(sb)
         {
             _encoding = encoding;
         }

+ 4 - 0
Emby.Dlna/Main/DlnaEntryPoint.cs

@@ -418,6 +418,10 @@ namespace Emby.Dlna.Main
             GC.SuppressFinalize(this);
         }
 
+        /// <summary>
+        /// Releases unmanaged and optionally managed resources.
+        /// </summary>
+        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
         protected virtual void Dispose(bool disposing)
         {
             if (_disposed)

+ 4 - 0
Emby.Dlna/PlayTo/Device.cs

@@ -1200,6 +1200,10 @@ namespace Emby.Dlna.PlayTo
             GC.SuppressFinalize(this);
         }
 
+        /// <summary>
+        /// Releases unmanaged and optionally managed resources.
+        /// </summary>
+        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
         protected virtual void Dispose(bool disposing)
         {
             if (_disposed)

+ 4 - 0
Emby.Dlna/PlayTo/PlayToController.cs

@@ -637,6 +637,10 @@ namespace Emby.Dlna.PlayTo
             GC.SuppressFinalize(this);
         }
 
+        /// <summary>
+        /// Releases unmanaged and optionally managed resources.
+        /// </summary>
+        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
         protected virtual void Dispose(bool disposing)
         {
             if (_disposed)

+ 1 - 1
Emby.Dlna/PlayTo/PlayToManager.cs

@@ -249,7 +249,7 @@ namespace Emby.Dlna.PlayTo
             }
             catch (Exception ex)
             {
-                _logger.LogDebug("Error while disposing PlayToManager", ex);
+                _logger.LogDebug(ex, "Error while disposing PlayToManager");
             }
 
             _sessionLock.Dispose();

+ 4 - 4
Emby.Dlna/Service/BaseControlHandler.cs

@@ -15,7 +15,7 @@ namespace Emby.Dlna.Service
 {
     public abstract class BaseControlHandler
     {
-        private const string NsSoapenv = "http://schemas.xmlsoap.org/soap/envelope/";
+        private const string NsSoapEnv = "http://schemas.xmlsoap.org/soap/envelope/";
 
         protected BaseControlHandler(IServerConfigurationManager config, ILogger logger)
         {
@@ -80,10 +80,10 @@ namespace Emby.Dlna.Service
             {
                 writer.WriteStartDocument(true);
 
-                writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapenv);
-                writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapenv, "http://schemas.xmlsoap.org/soap/encoding/");
+                writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapEnv);
+                writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapEnv, "http://schemas.xmlsoap.org/soap/encoding/");
 
-                writer.WriteStartElement("SOAP-ENV", "Body", NsSoapenv);
+                writer.WriteStartElement("SOAP-ENV", "Body", NsSoapEnv);
                 writer.WriteStartElement("u", requestInfo.LocalName + "Response", requestInfo.NamespaceURI);
 
                 WriteResult(requestInfo.LocalName, requestInfo.Headers, writer);

+ 5 - 5
Emby.Dlna/Service/ControlErrorHandler.cs

@@ -10,7 +10,7 @@ namespace Emby.Dlna.Service
 {
     public static class ControlErrorHandler
     {
-        private const string NsSoapenv = "http://schemas.xmlsoap.org/soap/envelope/";
+        private const string NsSoapEnv = "http://schemas.xmlsoap.org/soap/envelope/";
 
         public static ControlResponse GetResponse(Exception ex)
         {
@@ -26,11 +26,11 @@ namespace Emby.Dlna.Service
             {
                 writer.WriteStartDocument(true);
 
-                writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapenv);
-                writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapenv, "http://schemas.xmlsoap.org/soap/encoding/");
+                writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapEnv);
+                writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapEnv, "http://schemas.xmlsoap.org/soap/encoding/");
 
-                writer.WriteStartElement("SOAP-ENV", "Body", NsSoapenv);
-                writer.WriteStartElement("SOAP-ENV", "Fault", NsSoapenv);
+                writer.WriteStartElement("SOAP-ENV", "Body", NsSoapEnv);
+                writer.WriteStartElement("SOAP-ENV", "Fault", NsSoapEnv);
 
                 writer.WriteElementString("faultcode", "500");
                 writer.WriteElementString("faultstring", ex.Message);