Migrate NetworkManager and Tests to native .NET IP objects

This commit is contained in:
Shadowghost
2022-07-19 21:28:04 +02:00
parent c2902dd108
commit 066db8ac7f
18 changed files with 1116 additions and 2663 deletions

View File

@@ -1114,10 +1114,10 @@ namespace Emby.Server.Implementations
}
/// <inheritdoc/>
public string GetApiUrlForLocalAccess(IPObject hostname = null, bool allowHttps = true)
public string GetApiUrlForLocalAccess(IPAddress ipAddress = null, bool allowHttps = true)
{
// With an empty source, the port will be null
var smart = NetManager.GetBindInterface(hostname ?? IPHost.None, out _);
var smart = NetManager.GetBindInterface(ipAddress, out _);
var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
int? port = !allowHttps ? HttpPort : null;
return GetLocalApiUrl(smart, scheme, port);