diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2023-01-19 10:19:53 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2023-01-19 10:19:53 +0100 |
| commit | 343a94f185213d238364896a27a2968cc32ea618 (patch) | |
| tree | bda7fdcbf4a75f192112e98aee98f2de36ed55b1 | |
| parent | 656a0bff6fd48ba66cfe8fc7b470380c38afbac2 (diff) | |
Fix CA1851
| -rw-r--r-- | Jellyfin.Networking/Manager/NetworkManager.cs | 7 | ||||
| -rw-r--r-- | Jellyfin.Server/Extensions/WebHostBuilderExtensions.cs | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.cs index 031858206..f4bd4e766 100644 --- a/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/Jellyfin.Networking/Manager/NetworkManager.cs @@ -564,13 +564,13 @@ namespace Jellyfin.Networking.Manager if (_interfaces != null) { // Match all interfaces starting with names starting with token - var matchedInterfaces = _interfaces.Where(s => s.Name.Equals(intf, StringComparison.OrdinalIgnoreCase)).OrderBy(x => x.Index); + var matchedInterfaces = _interfaces.Where(s => s.Name.Equals(intf, StringComparison.OrdinalIgnoreCase)).OrderBy(x => x.Index).ToList(); if (matchedInterfaces.Any()) { _logger.LogInformation("Interface {Token} used in settings. Using its interface addresses.", intf); // Use interface IP instead of name - foreach (IPData iface in matchedInterfaces) + foreach (var iface in matchedInterfaces) { if ((IsIpv4Enabled && iface.Address.AddressFamily == AddressFamily.InterNetwork) || (IsIpv6Enabled && iface.Address.AddressFamily == AddressFamily.InterNetworkV6)) @@ -746,7 +746,8 @@ namespace Jellyfin.Networking.Manager // Get the first LAN interface address that's not excluded and not a loopback address. var availableInterfaces = _interfaces.Where(x => !IPAddress.IsLoopback(x.Address)) .OrderByDescending(x => IsInLocalNetwork(x.Address)) - .ThenBy(x => x.Index); + .ThenBy(x => x.Index) + .ToList(); if (availableInterfaces.Any()) { diff --git a/Jellyfin.Server/Extensions/WebHostBuilderExtensions.cs b/Jellyfin.Server/Extensions/WebHostBuilderExtensions.cs index 58d3e1b2d..eac13f761 100644 --- a/Jellyfin.Server/Extensions/WebHostBuilderExtensions.cs +++ b/Jellyfin.Server/Extensions/WebHostBuilderExtensions.cs @@ -39,7 +39,7 @@ public static class WebHostBuilderExtensions var addresses = appHost.NetManager.GetAllBindInterfaces(); bool flagged = false; - foreach (IPObject netAdd in addresses) + foreach (var netAdd in addresses) { logger.LogInformation("Kestrel listening on {Address}", IPAddress.IPv6Any.Equals(netAdd.Address) ? "All Addresses" : netAdd); options.Listen(netAdd.Address, appHost.HttpPort); |
