Merge pull request #506 from hawken93/linting
Removing tabs and trailing whitespace
This commit is contained in:
commit
15c89d281e
|
@ -43,7 +43,6 @@ namespace UniversalDetector.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class CharDistributionAnalyser
|
public abstract class CharDistributionAnalyser
|
||||||
{
|
{
|
||||||
|
|
||||||
protected const float SURE_YES = 0.99f;
|
protected const float SURE_YES = 0.99f;
|
||||||
protected const float SURE_NO = 0.01f;
|
protected const float SURE_NO = 0.01f;
|
||||||
protected const int MINIMUM_DATA_THRESHOLD = 4;
|
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
|
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,
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,22 +12,21 @@ namespace Emby.XmlTv.Test
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class XmlTvReaderLanguageTests
|
public class XmlTvReaderLanguageTests
|
||||||
{
|
{
|
||||||
/*
|
/* <title lang="es">Homes Under the Hammer - Spanish</title>
|
||||||
<title lang="es">Homes Under the Hammer - Spanish</title>
|
* <title lang="es">Homes Under the Hammer - Spanish 2</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</title>
|
* <title lang="en">Homes Under the Hammer - English 2</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</title>
|
* <title lang="">Homes Under the Hammer - Empty Language 2</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</title>
|
* <title>Homes Under the Hammer - No Language 2</title>
|
||||||
<title>Homes Under the Hammer - No Language 2</title>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Expected Behaviour:
|
/* Expected Behaviour:
|
||||||
- Language = Null Homes Under the Hammer - No Language
|
* - Language = Null Homes Under the Hammer - No Language
|
||||||
- Language = "" Homes Under the Hammer - No Language
|
* - Language = "" Homes Under the Hammer - No Language
|
||||||
- Language = es Homes Under the Hammer - Spanish
|
* - Language = es Homes Under the Hammer - Spanish
|
||||||
- Language = en Homes Under the Hammer - English
|
* - Language = en Homes Under the Hammer - English
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|
|
@ -832,22 +832,21 @@ namespace Emby.XmlTv.Classes
|
||||||
|
|
||||||
public void ProcessNode(XmlReader reader, Action<string> setter, string languageRequired = null, Action<string> allOccurrencesSetter = null)
|
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</title>
|
* <title lang="es">Homes Under the Hammer - Spanish 2</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</title>
|
* <title lang="en">Homes Under the Hammer - English 2</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</title>
|
* <title lang="">Homes Under the Hammer - Empty Language 2</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</title>
|
* <title>Homes Under the Hammer - No Language 2</title>
|
||||||
<title>Homes Under the Hammer - No Language 2</title>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Expected Behaviour:
|
/* Expected Behaviour:
|
||||||
- Language = Null Homes Under the Hammer - No Language
|
* - Language = Null Homes Under the Hammer - No Language
|
||||||
- Language = "" Homes Under the Hammer - No Language
|
* - Language = "" Homes Under the Hammer - No Language
|
||||||
- Language = es Homes Under the Hammer - Spanish
|
* - Language = es Homes Under the Hammer - Spanish
|
||||||
- Language = en Homes Under the Hammer - English
|
* - Language = en Homes Under the Hammer - English
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var results = new List<Tuple<string, string>>();
|
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)
|
public void ProcessMultipleNodes(XmlReader reader, Action<string> setter, string languageRequired = null)
|
||||||
{
|
{
|
||||||
/*
|
/* <category lang="en">Property - English</category>
|
||||||
<category lang="en">Property - English</category>
|
* <category lang="en">Property - English 2</category>
|
||||||
<category lang="en">Property - English 2</category>
|
* <category lang="es">Property - Spanish</category>
|
||||||
<category lang="es">Property - Spanish</category>
|
* <category lang="es">Property - Spanish 2</category>
|
||||||
<category lang="es">Property - Spanish 2</category>
|
* <category lang="">Property - Empty Language</category>
|
||||||
<category lang="">Property - Empty Language</category>
|
* <category lang="">Property - Empty Language 2</category>
|
||||||
<category lang="">Property - Empty Language 2</category>
|
* <category>Property - No Language</category>
|
||||||
<category>Property - No Language</category>
|
* <category>Property - No Language 2</category>
|
||||||
<category>Property - No Language 2</category>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Expected Behaviour:
|
/* Expected Behaviour:
|
||||||
- Language = Null Property - No Language / Property - No Language 2
|
* - Language = Null Property - No Language / Property - No Language 2
|
||||||
- Language = "" Property - Empty Language / Property - Empty Language 2
|
* - Language = "" Property - Empty Language / Property - Empty Language 2
|
||||||
- Language = es Property - Spanish / Property - Spanish 2
|
* - Language = es Property - Spanish / Property - Spanish 2
|
||||||
- Language = en Property - English / Property - English 2
|
* - Language = en Property - English / Property - English 2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var currentElementName = reader.Name;
|
var currentElementName = reader.Name;
|
||||||
|
|
|
@ -1706,7 +1706,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
if (string.Equals(outputVideoCodec, "libvpx", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(outputVideoCodec, "libvpx", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// per docs:
|
// 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);
|
return Math.Max(Environment.ProcessorCount - 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ namespace MediaBrowser.Model.Net
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISocketFactory
|
public interface ISocketFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Createa a new unicast socket using the specified local port number.
|
/// Createa a new unicast socket using the specified local port number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -265,259 +265,29 @@ namespace MediaBrowser.Model.Services
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly char[] entities_values = new char[] {
|
static readonly char[] entities_values = new char[] {
|
||||||
'\u00C6',
|
'\u00C6', '\u00C1', '\u00C2', '\u00C0', '\u0391', '\u00C5', '\u00C3', '\u00C4', '\u0392', '\u00C7', '\u03A7',
|
||||||
'\u00C1',
|
'\u2021', '\u0394', '\u00D0', '\u00C9', '\u00CA', '\u00C8', '\u0395', '\u0397', '\u00CB', '\u0393', '\u00CD',
|
||||||
'\u00C2',
|
'\u00CE', '\u00CC', '\u0399', '\u00CF', '\u039A', '\u039B', '\u039C', '\u00D1', '\u039D', '\u0152', '\u00D3',
|
||||||
'\u00C0',
|
'\u00D4', '\u00D2', '\u03A9', '\u039F', '\u00D8', '\u00D5', '\u00D6', '\u03A6', '\u03A0', '\u2033', '\u03A8',
|
||||||
'\u0391',
|
'\u03A1', '\u0160', '\u03A3', '\u00DE', '\u03A4', '\u0398', '\u00DA', '\u00DB', '\u00D9', '\u03A5', '\u00DC',
|
||||||
'\u00C5',
|
'\u039E', '\u00DD', '\u0178', '\u0396', '\u00E1', '\u00E2', '\u00B4', '\u00E6', '\u00E0', '\u2135', '\u03B1',
|
||||||
'\u00C3',
|
'\u0026', '\u2227', '\u2220', '\u0027', '\u00E5', '\u2248', '\u00E3', '\u00E4', '\u201E', '\u03B2', '\u00A6',
|
||||||
'\u00C4',
|
'\u2022', '\u2229', '\u00E7', '\u00B8', '\u00A2', '\u03C7', '\u02C6', '\u2663', '\u2245', '\u00A9', '\u21B5',
|
||||||
'\u0392',
|
'\u222A', '\u00A4', '\u21D3', '\u2020', '\u2193', '\u00B0', '\u03B4', '\u2666', '\u00F7', '\u00E9', '\u00EA',
|
||||||
'\u00C7',
|
'\u00E8', '\u2205', '\u2003', '\u2002', '\u03B5', '\u2261', '\u03B7', '\u00F0', '\u00EB', '\u20AC', '\u2203',
|
||||||
'\u03A7',
|
'\u0192', '\u2200', '\u00BD', '\u00BC', '\u00BE', '\u2044', '\u03B3', '\u2265', '\u003E', '\u21D4', '\u2194',
|
||||||
'\u2021',
|
'\u2665', '\u2026', '\u00ED', '\u00EE', '\u00A1', '\u00EC', '\u2111', '\u221E', '\u222B', '\u03B9', '\u00BF',
|
||||||
'\u0394',
|
'\u2208', '\u00EF', '\u03BA', '\u21D0', '\u03BB', '\u2329', '\u00AB', '\u2190', '\u2308', '\u201C', '\u2264',
|
||||||
'\u00D0',
|
'\u230A', '\u2217', '\u25CA', '\u200E', '\u2039', '\u2018', '\u003C', '\u00AF', '\u2014', '\u00B5', '\u00B7',
|
||||||
'\u00C9',
|
'\u2212', '\u03BC', '\u2207', '\u00A0', '\u2013', '\u2260', '\u220B', '\u00AC', '\u2209', '\u2284', '\u00F1',
|
||||||
'\u00CA',
|
'\u03BD', '\u00F3', '\u00F4', '\u0153', '\u00F2', '\u203E', '\u03C9', '\u03BF', '\u2295', '\u2228', '\u00AA',
|
||||||
'\u00C8',
|
'\u00BA', '\u00F8', '\u00F5', '\u2297', '\u00F6', '\u00B6', '\u2202', '\u2030', '\u22A5', '\u03C6', '\u03C0',
|
||||||
'\u0395',
|
'\u03D6', '\u00B1', '\u00A3', '\u2032', '\u220F', '\u221D', '\u03C8', '\u0022', '\u21D2', '\u221A', '\u232A',
|
||||||
'\u0397',
|
'\u00BB', '\u2192', '\u2309', '\u201D', '\u211C', '\u00AE', '\u230B', '\u03C1', '\u200F', '\u203A', '\u2019',
|
||||||
'\u00CB',
|
'\u201A', '\u0161', '\u22C5', '\u00A7', '\u00AD', '\u03C3', '\u03C2', '\u223C', '\u2660', '\u2282', '\u2286',
|
||||||
'\u0393',
|
'\u2211', '\u2283', '\u00B9', '\u00B2', '\u00B3', '\u2287', '\u00DF', '\u03C4', '\u2234', '\u03B8', '\u03D1',
|
||||||
'\u00CD',
|
'\u2009', '\u00FE', '\u02DC', '\u00D7', '\u2122', '\u21D1', '\u00FA', '\u2191', '\u00FB', '\u00F9', '\u00A8',
|
||||||
'\u00CE',
|
'\u03D2', '\u03C5', '\u00FC', '\u2118', '\u03BE', '\u00FD', '\u00A5', '\u00FF', '\u03B6', '\u200D', '\u200C'
|
||||||
'\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
|
#region Methods
|
||||||
|
|
|
@ -62,7 +62,15 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
||||||
return list;
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,8 @@ namespace Mono.Nat
|
||||||
{
|
{
|
||||||
private DateTime lastSeen;
|
private DateTime lastSeen;
|
||||||
|
|
||||||
protected AbstractNatDevice ()
|
protected AbstractNatDevice()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract IPAddress LocalAddress { get; }
|
public abstract IPAddress LocalAddress { get; }
|
||||||
|
|
|
@ -39,14 +39,12 @@ namespace Mono.Nat
|
||||||
private Protocol protocol;
|
private Protocol protocol;
|
||||||
private int publicPort;
|
private int publicPort;
|
||||||
|
|
||||||
|
public Mapping(Protocol protocol, int privatePort, int publicPort)
|
||||||
|
|
||||||
public Mapping (Protocol protocol, int privatePort, int publicPort)
|
|
||||||
: this (protocol, privatePort, publicPort, 0)
|
: 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.protocol = protocol;
|
||||||
this.privatePort = privatePort;
|
this.privatePort = privatePort;
|
||||||
|
@ -97,12 +95,12 @@ namespace Mono.Nat
|
||||||
internal set { expiration = value; }
|
internal set { expiration = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsExpired ()
|
public bool IsExpired()
|
||||||
{
|
{
|
||||||
return expiration < DateTime.Now;
|
return expiration < DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals (object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
Mapping other = obj as Mapping;
|
Mapping other = obj as Mapping;
|
||||||
return other == null ? false : this.protocol == other.protocol &&
|
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();
|
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}",
|
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 );
|
this.protocol, this.publicPort, this.privatePort, this.description, this.expiration, this.lifetime );
|
||||||
|
|
|
@ -71,15 +71,15 @@ namespace Mono.Nat
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
/* For UPnP Port Mapping we need ot find either WANPPPConnection or WANIPConnection.
|
/* 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
|
* 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.
|
* page 5 for an overview of device types and their hierarchy.
|
||||||
http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf */
|
* 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
|
/* 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
|
/* 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
|
// We have an internet gateway device now
|
||||||
UpnpNatDevice d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient);
|
UpnpNatDevice d = new UpnpNatDevice(localAddress, deviceInfo, endpoint, string.Empty, _logger, _httpClient);
|
||||||
|
|
|
@ -57,6 +57,5 @@ namespace Rssdp
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -92,6 +92,5 @@ namespace Rssdp.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -32,6 +32,5 @@ namespace Rssdp.Infrastructure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <seealso cref="SsdpDevice"/>
|
/// <seealso cref="SsdpDevice"/>
|
||||||
System.Collections.Generic.IEnumerable<SsdpRootDevice> Devices { get; }
|
System.Collections.Generic.IEnumerable<SsdpRootDevice> Devices { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ namespace Rssdp.Infrastructure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class RequestReceivedEventArgs : EventArgs
|
public sealed class RequestReceivedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
private readonly HttpRequestMessage _Message;
|
private readonly HttpRequestMessage _Message;
|
||||||
|
@ -56,6 +55,5 @@ namespace Rssdp.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -55,6 +55,5 @@ namespace Rssdp.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,21 +20,18 @@ namespace Rssdp.Infrastructure
|
||||||
|
|
||||||
#region Fields
|
#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
|
||||||
We could technically use one socket listening on port 1900 for everything.
|
* this often doesn't work under Windows because the MS SSDP service is running. If that service
|
||||||
This should get both multicast (notifications) and unicast (search response) messages, however
|
* is running then it will steal the unicast messages and we will never see search responses.
|
||||||
this often doesn't work under Windows because the MS SSDP service is running. If that service
|
* Since stopping the service would be a bad idea (might not be allowed security wise and might
|
||||||
is running then it will steal the unicast messages and we will never see search responses.
|
* break other apps running on the system) the only other work around is to use two sockets.
|
||||||
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
|
||||||
We use one socket to listen for/receive notifications and search requests (_BroadcastListenSocket).
|
* responses (_SendSocket). The responses are sent to the local port this socket is bound to,
|
||||||
We use a second socket, bound to a different local port, to send search requests and listen for
|
* which isn't port 1900 so the MS service doesn't steal them. While the caller can specify a local
|
||||||
responses (_SendSocket). The responses are sent to the local port this socket is bound to,
|
* port to use, we will default to 0 which allows the underlying system to auto-assign a free port.
|
||||||
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();
|
private object _BroadcastListenSocketSynchroniser = new object();
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace Rssdp
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
private SsdpRootDevice _RootDevice;
|
private SsdpRootDevice _RootDevice;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -52,6 +51,5 @@ namespace Rssdp
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,7 +15,6 @@ namespace Rssdp
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class SsdpRootDevice : SsdpDevice
|
public class SsdpRootDevice : SsdpDevice
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
private Uri _UrlBase;
|
private Uri _UrlBase;
|
||||||
|
@ -74,6 +73,5 @@ namespace Rssdp
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user