Merge pull request #506 from hawken93/linting

Removing tabs and trailing whitespace
This commit is contained in:
Joshua M. Boniface 2019-01-10 19:54:18 -05:00 committed by GitHub
commit 15c89d281e
345 changed files with 3264 additions and 3508 deletions

View File

@ -43,7 +43,6 @@ namespace UniversalDetector.Core
/// </summary>
public abstract class CharDistributionAnalyser
{
protected const float SURE_YES = 0.99f;
protected const float SURE_NO = 0.01f;
protected const int MINIMUM_DATA_THRESHOLD = 4;
@ -1216,7 +1215,7 @@ namespace UniversalDetector.Core
670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, //512, 256
/***************************************************************************************
* Everything below is of no interest for detection purpose
* Everything below is of no interest for detection purpose *
***************************************************************************************
2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,
@ -3168,6 +3167,4 @@ namespace UniversalDetector.Core
return -1;
}
}
}

View File

@ -12,22 +12,21 @@ namespace Emby.XmlTv.Test
[TestClass]
public class XmlTvReaderLanguageTests
{
/*
<title lang="es">Homes Under the Hammer - Spanish</title>
<title lang="es">Homes Under the Hammer - Spanish 2</title>
<title lang="en">Homes Under the Hammer - English</title>
<title lang="en">Homes Under the Hammer - English 2</title>
<title lang="">Homes Under the Hammer - Empty Language</title>
<title lang="">Homes Under the Hammer - Empty Language 2</title>
<title>Homes Under the Hammer - No Language</title>
<title>Homes Under the Hammer - No Language 2</title>
/* <title lang="es">Homes Under the Hammer - Spanish</title>
* <title lang="es">Homes Under the Hammer - Spanish 2</title>
* <title lang="en">Homes Under the Hammer - English</title>
* <title lang="en">Homes Under the Hammer - English 2</title>
* <title lang="">Homes Under the Hammer - Empty Language</title>
* <title lang="">Homes Under the Hammer - Empty Language 2</title>
* <title>Homes Under the Hammer - No Language</title>
* <title>Homes Under the Hammer - No Language 2</title>
*/
/* Expected Behaviour:
- Language = Null Homes Under the Hammer - No Language
- Language = "" Homes Under the Hammer - No Language
- Language = es Homes Under the Hammer - Spanish
- Language = en Homes Under the Hammer - English
* - Language = Null Homes Under the Hammer - No Language
* - Language = "" Homes Under the Hammer - No Language
* - Language = es Homes Under the Hammer - Spanish
* - Language = en Homes Under the Hammer - English
*/
[TestMethod]

View File

@ -832,22 +832,21 @@ namespace Emby.XmlTv.Classes
public void ProcessNode(XmlReader reader, Action<string> setter, string languageRequired = null, Action<string> allOccurrencesSetter = null)
{
/*
<title lang="es">Homes Under the Hammer - Spanish</title>
<title lang="es">Homes Under the Hammer - Spanish 2</title>
<title lang="en">Homes Under the Hammer - English</title>
<title lang="en">Homes Under the Hammer - English 2</title>
<title lang="">Homes Under the Hammer - Empty Language</title>
<title lang="">Homes Under the Hammer - Empty Language 2</title>
<title>Homes Under the Hammer - No Language</title>
<title>Homes Under the Hammer - No Language 2</title>
/* <title lang="es">Homes Under the Hammer - Spanish</title>
* <title lang="es">Homes Under the Hammer - Spanish 2</title>
* <title lang="en">Homes Under the Hammer - English</title>
* <title lang="en">Homes Under the Hammer - English 2</title>
* <title lang="">Homes Under the Hammer - Empty Language</title>
* <title lang="">Homes Under the Hammer - Empty Language 2</title>
* <title>Homes Under the Hammer - No Language</title>
* <title>Homes Under the Hammer - No Language 2</title>
*/
/* Expected Behaviour:
- Language = Null Homes Under the Hammer - No Language
- Language = "" Homes Under the Hammer - No Language
- Language = es Homes Under the Hammer - Spanish
- Language = en Homes Under the Hammer - English
* - Language = Null Homes Under the Hammer - No Language
* - Language = "" Homes Under the Hammer - No Language
* - Language = es Homes Under the Hammer - Spanish
* - Language = en Homes Under the Hammer - English
*/
var results = new List<Tuple<string, string>>();
@ -921,22 +920,21 @@ namespace Emby.XmlTv.Classes
public void ProcessMultipleNodes(XmlReader reader, Action<string> setter, string languageRequired = null)
{
/*
<category lang="en">Property - English</category>
<category lang="en">Property - English 2</category>
<category lang="es">Property - Spanish</category>
<category lang="es">Property - Spanish 2</category>
<category lang="">Property - Empty Language</category>
<category lang="">Property - Empty Language 2</category>
<category>Property - No Language</category>
<category>Property - No Language 2</category>
/* <category lang="en">Property - English</category>
* <category lang="en">Property - English 2</category>
* <category lang="es">Property - Spanish</category>
* <category lang="es">Property - Spanish 2</category>
* <category lang="">Property - Empty Language</category>
* <category lang="">Property - Empty Language 2</category>
* <category>Property - No Language</category>
* <category>Property - No Language 2</category>
*/
/* Expected Behaviour:
- Language = Null Property - No Language / Property - No Language 2
- Language = "" Property - Empty Language / Property - Empty Language 2
- Language = es Property - Spanish / Property - Spanish 2
- Language = en Property - English / Property - English 2
* - Language = Null Property - No Language / Property - No Language 2
* - Language = "" Property - Empty Language / Property - Empty Language 2
* - Language = es Property - Spanish / Property - Spanish 2
* - Language = en Property - English / Property - English 2
*/
var currentElementName = reader.Name;

View File

@ -1706,7 +1706,8 @@ namespace MediaBrowser.Controller.MediaEncoding
if (string.Equals(outputVideoCodec, "libvpx", StringComparison.OrdinalIgnoreCase))
{
// per docs:
// -threads number of threads to use for encoding, can't be 0 [auto] with VP8 (recommended value : number of real cores - 1)
// -threads number of threads to use for encoding, can't be 0 [auto] with VP8
// (recommended value : number of real cores - 1)
return Math.Max(Environment.ProcessorCount - 1, 1);
}

View File

@ -8,7 +8,6 @@ namespace MediaBrowser.Model.Net
/// </summary>
public interface ISocketFactory
{
/// <summary>
/// Createa a new unicast socket using the specified local port number.
/// </summary>

View File

@ -265,259 +265,29 @@ namespace MediaBrowser.Model.Services
};
static readonly char[] entities_values = new char[] {
'\u00C6',
'\u00C1',
'\u00C2',
'\u00C0',
'\u0391',
'\u00C5',
'\u00C3',
'\u00C4',
'\u0392',
'\u00C7',
'\u03A7',
'\u2021',
'\u0394',
'\u00D0',
'\u00C9',
'\u00CA',
'\u00C8',
'\u0395',
'\u0397',
'\u00CB',
'\u0393',
'\u00CD',
'\u00CE',
'\u00CC',
'\u0399',
'\u00CF',
'\u039A',
'\u039B',
'\u039C',
'\u00D1',
'\u039D',
'\u0152',
'\u00D3',
'\u00D4',
'\u00D2',
'\u03A9',
'\u039F',
'\u00D8',
'\u00D5',
'\u00D6',
'\u03A6',
'\u03A0',
'\u2033',
'\u03A8',
'\u03A1',
'\u0160',
'\u03A3',
'\u00DE',
'\u03A4',
'\u0398',
'\u00DA',
'\u00DB',
'\u00D9',
'\u03A5',
'\u00DC',
'\u039E',
'\u00DD',
'\u0178',
'\u0396',
'\u00E1',
'\u00E2',
'\u00B4',
'\u00E6',
'\u00E0',
'\u2135',
'\u03B1',
'\u0026',
'\u2227',
'\u2220',
'\u0027',
'\u00E5',
'\u2248',
'\u00E3',
'\u00E4',
'\u201E',
'\u03B2',
'\u00A6',
'\u2022',
'\u2229',
'\u00E7',
'\u00B8',
'\u00A2',
'\u03C7',
'\u02C6',
'\u2663',
'\u2245',
'\u00A9',
'\u21B5',
'\u222A',
'\u00A4',
'\u21D3',
'\u2020',
'\u2193',
'\u00B0',
'\u03B4',
'\u2666',
'\u00F7',
'\u00E9',
'\u00EA',
'\u00E8',
'\u2205',
'\u2003',
'\u2002',
'\u03B5',
'\u2261',
'\u03B7',
'\u00F0',
'\u00EB',
'\u20AC',
'\u2203',
'\u0192',
'\u2200',
'\u00BD',
'\u00BC',
'\u00BE',
'\u2044',
'\u03B3',
'\u2265',
'\u003E',
'\u21D4',
'\u2194',
'\u2665',
'\u2026',
'\u00ED',
'\u00EE',
'\u00A1',
'\u00EC',
'\u2111',
'\u221E',
'\u222B',
'\u03B9',
'\u00BF',
'\u2208',
'\u00EF',
'\u03BA',
'\u21D0',
'\u03BB',
'\u2329',
'\u00AB',
'\u2190',
'\u2308',
'\u201C',
'\u2264',
'\u230A',
'\u2217',
'\u25CA',
'\u200E',
'\u2039',
'\u2018',
'\u003C',
'\u00AF',
'\u2014',
'\u00B5',
'\u00B7',
'\u2212',
'\u03BC',
'\u2207',
'\u00A0',
'\u2013',
'\u2260',
'\u220B',
'\u00AC',
'\u2209',
'\u2284',
'\u00F1',
'\u03BD',
'\u00F3',
'\u00F4',
'\u0153',
'\u00F2',
'\u203E',
'\u03C9',
'\u03BF',
'\u2295',
'\u2228',
'\u00AA',
'\u00BA',
'\u00F8',
'\u00F5',
'\u2297',
'\u00F6',
'\u00B6',
'\u2202',
'\u2030',
'\u22A5',
'\u03C6',
'\u03C0',
'\u03D6',
'\u00B1',
'\u00A3',
'\u2032',
'\u220F',
'\u221D',
'\u03C8',
'\u0022',
'\u21D2',
'\u221A',
'\u232A',
'\u00BB',
'\u2192',
'\u2309',
'\u201D',
'\u211C',
'\u00AE',
'\u230B',
'\u03C1',
'\u200F',
'\u203A',
'\u2019',
'\u201A',
'\u0161',
'\u22C5',
'\u00A7',
'\u00AD',
'\u03C3',
'\u03C2',
'\u223C',
'\u2660',
'\u2282',
'\u2286',
'\u2211',
'\u2283',
'\u00B9',
'\u00B2',
'\u00B3',
'\u2287',
'\u00DF',
'\u03C4',
'\u2234',
'\u03B8',
'\u03D1',
'\u2009',
'\u00FE',
'\u02DC',
'\u00D7',
'\u2122',
'\u21D1',
'\u00FA',
'\u2191',
'\u00FB',
'\u00F9',
'\u00A8',
'\u03D2',
'\u03C5',
'\u00FC',
'\u2118',
'\u03BE',
'\u00FD',
'\u00A5',
'\u00FF',
'\u03B6',
'\u200D',
'\u200C'
'\u00C6', '\u00C1', '\u00C2', '\u00C0', '\u0391', '\u00C5', '\u00C3', '\u00C4', '\u0392', '\u00C7', '\u03A7',
'\u2021', '\u0394', '\u00D0', '\u00C9', '\u00CA', '\u00C8', '\u0395', '\u0397', '\u00CB', '\u0393', '\u00CD',
'\u00CE', '\u00CC', '\u0399', '\u00CF', '\u039A', '\u039B', '\u039C', '\u00D1', '\u039D', '\u0152', '\u00D3',
'\u00D4', '\u00D2', '\u03A9', '\u039F', '\u00D8', '\u00D5', '\u00D6', '\u03A6', '\u03A0', '\u2033', '\u03A8',
'\u03A1', '\u0160', '\u03A3', '\u00DE', '\u03A4', '\u0398', '\u00DA', '\u00DB', '\u00D9', '\u03A5', '\u00DC',
'\u039E', '\u00DD', '\u0178', '\u0396', '\u00E1', '\u00E2', '\u00B4', '\u00E6', '\u00E0', '\u2135', '\u03B1',
'\u0026', '\u2227', '\u2220', '\u0027', '\u00E5', '\u2248', '\u00E3', '\u00E4', '\u201E', '\u03B2', '\u00A6',
'\u2022', '\u2229', '\u00E7', '\u00B8', '\u00A2', '\u03C7', '\u02C6', '\u2663', '\u2245', '\u00A9', '\u21B5',
'\u222A', '\u00A4', '\u21D3', '\u2020', '\u2193', '\u00B0', '\u03B4', '\u2666', '\u00F7', '\u00E9', '\u00EA',
'\u00E8', '\u2205', '\u2003', '\u2002', '\u03B5', '\u2261', '\u03B7', '\u00F0', '\u00EB', '\u20AC', '\u2203',
'\u0192', '\u2200', '\u00BD', '\u00BC', '\u00BE', '\u2044', '\u03B3', '\u2265', '\u003E', '\u21D4', '\u2194',
'\u2665', '\u2026', '\u00ED', '\u00EE', '\u00A1', '\u00EC', '\u2111', '\u221E', '\u222B', '\u03B9', '\u00BF',
'\u2208', '\u00EF', '\u03BA', '\u21D0', '\u03BB', '\u2329', '\u00AB', '\u2190', '\u2308', '\u201C', '\u2264',
'\u230A', '\u2217', '\u25CA', '\u200E', '\u2039', '\u2018', '\u003C', '\u00AF', '\u2014', '\u00B5', '\u00B7',
'\u2212', '\u03BC', '\u2207', '\u00A0', '\u2013', '\u2260', '\u220B', '\u00AC', '\u2209', '\u2284', '\u00F1',
'\u03BD', '\u00F3', '\u00F4', '\u0153', '\u00F2', '\u203E', '\u03C9', '\u03BF', '\u2295', '\u2228', '\u00AA',
'\u00BA', '\u00F8', '\u00F5', '\u2297', '\u00F6', '\u00B6', '\u2202', '\u2030', '\u22A5', '\u03C6', '\u03C0',
'\u03D6', '\u00B1', '\u00A3', '\u2032', '\u220F', '\u221D', '\u03C8', '\u0022', '\u21D2', '\u221A', '\u232A',
'\u00BB', '\u2192', '\u2309', '\u201D', '\u211C', '\u00AE', '\u230B', '\u03C1', '\u200F', '\u203A', '\u2019',
'\u201A', '\u0161', '\u22C5', '\u00A7', '\u00AD', '\u03C3', '\u03C2', '\u223C', '\u2660', '\u2282', '\u2286',
'\u2211', '\u2283', '\u00B9', '\u00B2', '\u00B3', '\u2287', '\u00DF', '\u03C4', '\u2234', '\u03B8', '\u03D1',
'\u2009', '\u00FE', '\u02DC', '\u00D7', '\u2122', '\u21D1', '\u00FA', '\u2191', '\u00FB', '\u00F9', '\u00A8',
'\u03D2', '\u03C5', '\u00FC', '\u2118', '\u03BE', '\u00FD', '\u00A5', '\u00FF', '\u03B6', '\u200D', '\u200C'
};
#region Methods

View File

@ -62,7 +62,15 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
public SeasonNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
public SeasonNfoSaver(
IFileSystem fileSystem,
IServerConfigurationManager configurationManager,
ILibraryManager libraryManager,
IUserManager userManager,
IUserDataManager userDataManager,
ILogger logger,
IXmlReaderSettingsFactory xmlReaderSettingsFactory)
: base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
{
}
}

View File

@ -38,9 +38,8 @@ namespace Mono.Nat
{
private DateTime lastSeen;
protected AbstractNatDevice ()
protected AbstractNatDevice()
{
}
public abstract IPAddress LocalAddress { get; }

View File

@ -39,14 +39,12 @@ namespace Mono.Nat
private Protocol protocol;
private int publicPort;
public Mapping (Protocol protocol, int privatePort, int publicPort)
public Mapping(Protocol protocol, int privatePort, int publicPort)
: this (protocol, privatePort, publicPort, 0)
{
}
public Mapping (Protocol protocol, int privatePort, int publicPort, int lifetime)
public Mapping(Protocol protocol, int privatePort, int publicPort, int lifetime)
{
this.protocol = protocol;
this.privatePort = privatePort;
@ -97,12 +95,12 @@ namespace Mono.Nat
internal set { expiration = value; }
}
public bool IsExpired ()
public bool IsExpired()
{
return expiration < DateTime.Now;
}
public override bool Equals (object obj)
public override bool Equals(object obj)
{
Mapping other = obj as Mapping;
return other == null ? false : this.protocol == other.protocol &&
@ -114,7 +112,7 @@ namespace Mono.Nat
return this.protocol.GetHashCode() ^ this.privatePort.GetHashCode() ^ this.publicPort.GetHashCode();
}
public override string ToString( )
public override string ToString()
{
return String.Format( "Protocol: {0}, Public Port: {1}, Private Port: {2}, Description: {3}, Expiration: {4}, Lifetime: {5}",
this.protocol, this.publicPort, this.privatePort, this.description, this.expiration, this.lifetime );

View File

@ -71,15 +71,15 @@ namespace Mono.Nat
try
{
/* For UPnP Port Mapping we need ot find either WANPPPConnection or WANIPConnection.
Any other device type is no good to us for this purpose. See the IGP overview paper
page 5 for an overview of device types and their hierarchy.
http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf */
* Any other device type is no good to us for this purpose. See the IGP overview paper
* page 5 for an overview of device types and their hierarchy.
* http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf */
/* TODO: Currently we are assuming version 1 of the protocol. We should figure out which
version it is and apply the correct URN. */
* version it is and apply the correct URN. */
/* Some routers don't correctly implement the version ID on the URN, so we only search for the type
prefix. */
* prefix. */
// We have an internet gateway device now
UpnpNatDevice d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient);

View File

@ -57,6 +57,5 @@ namespace Rssdp
}
#endregion
}
}

View File

@ -92,6 +92,5 @@ namespace Rssdp.Infrastructure
}
#endregion
}
}

View File

@ -32,6 +32,5 @@ namespace Rssdp.Infrastructure
/// </summary>
/// <seealso cref="SsdpDevice"/>
System.Collections.Generic.IEnumerable<SsdpRootDevice> Devices { get; }
}
}

View File

@ -13,7 +13,6 @@ namespace Rssdp.Infrastructure
/// </summary>
public sealed class RequestReceivedEventArgs : EventArgs
{
#region Fields
private readonly HttpRequestMessage _Message;
@ -56,6 +55,5 @@ namespace Rssdp.Infrastructure
}
#endregion
}
}

View File

@ -55,6 +55,5 @@ namespace Rssdp.Infrastructure
}
#endregion
}
}

View File

@ -20,21 +20,18 @@ namespace Rssdp.Infrastructure
#region Fields
/*
We could technically use one socket listening on port 1900 for everything.
This should get both multicast (notifications) and unicast (search response) messages, however
this often doesn't work under Windows because the MS SSDP service is running. If that service
is running then it will steal the unicast messages and we will never see search responses.
Since stopping the service would be a bad idea (might not be allowed security wise and might
break other apps running on the system) the only other work around is to use two sockets.
We use one socket to listen for/receive notifications and search requests (_BroadcastListenSocket).
We use a second socket, bound to a different local port, to send search requests and listen for
responses (_SendSocket). The responses are sent to the local port this socket is bound to,
which isn't port 1900 so the MS service doesn't steal them. While the caller can specify a local
port to use, we will default to 0 which allows the underlying system to auto-assign a free port.
/* We could technically use one socket listening on port 1900 for everything.
* This should get both multicast (notifications) and unicast (search response) messages, however
* this often doesn't work under Windows because the MS SSDP service is running. If that service
* is running then it will steal the unicast messages and we will never see search responses.
* Since stopping the service would be a bad idea (might not be allowed security wise and might
* break other apps running on the system) the only other work around is to use two sockets.
*
* We use one socket to listen for/receive notifications and search requests (_BroadcastListenSocket).
* We use a second socket, bound to a different local port, to send search requests and listen for
* responses (_SendSocket). The responses are sent to the local port this socket is bound to,
* which isn't port 1900 so the MS service doesn't steal them. While the caller can specify a local
* port to use, we will default to 0 which allows the underlying system to auto-assign a free port.
*/
private object _BroadcastListenSocketSynchroniser = new object();

View File

@ -11,7 +11,6 @@ namespace Rssdp
{
#region Fields
private SsdpRootDevice _RootDevice;
#endregion
@ -52,6 +51,5 @@ namespace Rssdp
}
#endregion
}
}

View File

@ -15,7 +15,6 @@ namespace Rssdp
/// </remarks>
public class SsdpRootDevice : SsdpDevice
{
#region Fields
private Uri _UrlBase;
@ -74,6 +73,5 @@ namespace Rssdp
}
#endregion
}
}