Merge branch 'dev' into code-cleanup

This commit is contained in:
Erwin de Haan 2019-01-11 12:50:36 +01:00
commit e2751d42e8
345 changed files with 2991 additions and 3236 deletions

View file

@ -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;
} }
} }
} }

View file

@ -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]

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) 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;

View file

@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Library
/// <summary> /// <summary>
/// The TVDB API key /// The TVDB API key
/// </summary> /// </summary>
public static readonly string TvdbApiKey = "B89CE93890E9419B"; public static readonly string TvdbApiKey = "OG4V3YJ3FAP7FP2K";
public static readonly string TvdbBaseUrl = "https://www.thetvdb.com/"; public static readonly string TvdbBaseUrl = "https://www.thetvdb.com/";
/// <summary> /// <summary>
/// The banner URL /// The banner URL

View file

@ -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);
} }

View file

@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating; _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;
Utilities.HttpClient = httpClient; Utilities.HttpClient = httpClient;
OpenSubtitles.SetUserAgent("mediabrowser.tv"); OpenSubtitles.SetUserAgent("jellyfin");
} }
private const string PasswordHashPrefix = "h:"; private const string PasswordHashPrefix = "h:";

View file

@ -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>

View file

@ -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

View file

@ -37,7 +37,6 @@ namespace MediaBrowser.Providers.Movies
private readonly IJsonSerializer _json; private readonly IJsonSerializer _json;
private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3/movies/{1}?api_key={0}"; private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3/movies/{1}?api_key={0}";
// &client_key=52c813aa7b8c8b3bb87f4797532a2f8c
internal static FanartMovieImageProvider Current; internal static FanartMovieImageProvider Current;

View file

@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.Movies
private const string TmdbConfigUrl = BaseMovieDbUrl + "3/configuration?api_key={0}"; private const string TmdbConfigUrl = BaseMovieDbUrl + "3/configuration?api_key={0}";
private const string GetMovieInfo3 = BaseMovieDbUrl + @"3/movie/{0}?api_key={1}&append_to_response=casts,releases,images,keywords,trailers"; private const string GetMovieInfo3 = BaseMovieDbUrl + @"3/movie/{0}?api_key={1}&append_to_response=casts,releases,images,keywords,trailers";
internal static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669"; internal static string ApiKey = "4219e299c89411838049ab0dab19ebd5";
internal static string AcceptHeader = "application/json,image/*"; internal static string AcceptHeader = "application/json,image/*";
/// <summary> /// <summary>

View file

@ -20,7 +20,7 @@ namespace MediaBrowser.Providers.Movies
private static readonly CultureInfo EnUs = new CultureInfo("en-US"); private static readonly CultureInfo EnUs = new CultureInfo("en-US");
private const string Search3 = MovieDbProvider.BaseMovieDbUrl + @"3/search/{3}?api_key={1}&query={0}&language={2}"; private const string Search3 = MovieDbProvider.BaseMovieDbUrl + @"3/search/{3}?api_key={1}&query={0}&language={2}";
internal static string ApiKey = "f6bd687ffa63cd282b6ff2c6877f2669"; internal static string ApiKey = "4219e299c89411838049ab0dab19ebd5";
internal static string AcceptHeader = "application/json,image/*"; internal static string AcceptHeader = "application/json,image/*";
private readonly ILogger _logger; private readonly ILogger _logger;

View file

@ -27,7 +27,7 @@ namespace MediaBrowser.Providers.Music
public static AudioDbArtistProvider Current; public static AudioDbArtistProvider Current;
private const string ApiKey = "49jhsf8248yfahka89724011"; private const string ApiKey = "195003";
public const string BaseUrl = "https://www.theaudiodb.com/api/v1/json/" + ApiKey; public const string BaseUrl = "https://www.theaudiodb.com/api/v1/json/" + ApiKey;
public AudioDbArtistProvider(IServerConfigurationManager config, IFileSystem fileSystem, IHttpClient httpClient, IJsonSerializer json) public AudioDbArtistProvider(IServerConfigurationManager config, IFileSystem fileSystem, IHttpClient httpClient, IJsonSerializer json)

View file

@ -28,7 +28,7 @@ namespace MediaBrowser.Providers.Music
{ {
public class FanartArtistProvider : IRemoteImageProvider, IHasOrder public class FanartArtistProvider : IRemoteImageProvider, IHasOrder
{ {
internal const string ApiKey = "5c6b04c68e904cfed1e6cbc9a9e683d4"; internal const string ApiKey = "184e1a2b1fe3b94935365411f919f638";
private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3.1/music/{1}?api_key={0}"; private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3.1/music/{1}?api_key={0}";
private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private readonly CultureInfo _usCulture = new CultureInfo("en-US");

View file

@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.Omdb
list.Add(new RemoteImageInfo list.Add(new RemoteImageInfo
{ {
ProviderName = Name, ProviderName = Name,
Url = string.Format("https://img.omdbapi.com/?i={0}&apikey=fe53f97e", imdbId) Url = string.Format("https://img.omdbapi.com/?i={0}&apikey=2c9d9507", imdbId)
}); });
} }
} }

View file

@ -270,7 +270,7 @@ namespace MediaBrowser.Providers.Omdb
public static string GetOmdbUrl(string query, IApplicationHost appHost, CancellationToken cancellationToken) public static string GetOmdbUrl(string query, IApplicationHost appHost, CancellationToken cancellationToken)
{ {
const string url = "https://www.omdbapi.com?apikey=fe53f97e"; const string url = "https://www.omdbapi.com?apikey=2c9d9507";
if (string.IsNullOrWhiteSpace(query)) if (string.IsNullOrWhiteSpace(query))
{ {

View file

@ -36,7 +36,6 @@ namespace MediaBrowser.Providers.TV
private readonly IJsonSerializer _json; private readonly IJsonSerializer _json;
private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3/tv/{1}?api_key={0}"; private const string FanArtBaseUrl = "https://webservice.fanart.tv/v3/tv/{1}?api_key={0}";
// &client_key=52c813aa7b8c8b3bb87f4797532a2f8c
internal static FanartSeriesProvider Current { get; private set; } internal static FanartSeriesProvider Current { get; private set; }

View file

@ -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)
{ {
} }
} }

View file

@ -40,7 +40,6 @@ namespace Mono.Nat
protected AbstractNatDevice() protected AbstractNatDevice()
{ {
} }
public abstract IPAddress LocalAddress { get; } public abstract IPAddress LocalAddress { get; }

View file

@ -39,8 +39,6 @@ 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)
{ {

View file

@ -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);

View file

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

View file

@ -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; }
} }
} }

View file

@ -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
} }
} }

View file

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

View file

@ -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();

View file

@ -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
} }
} }

View file

@ -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
} }
} }