From 6f8d15ec8806ecf0dd56bb202cade919eb2dee72 Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Wed, 13 Dec 2023 23:21:13 +0100 Subject: [PATCH] Improve deletion of port mapping --- HyperbolicDownloaderApi/Managment/ApiManager.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/HyperbolicDownloaderApi/Managment/ApiManager.cs b/HyperbolicDownloaderApi/Managment/ApiManager.cs index 38ee6f1..b6135e0 100644 --- a/HyperbolicDownloaderApi/Managment/ApiManager.cs +++ b/HyperbolicDownloaderApi/Managment/ApiManager.cs @@ -94,14 +94,7 @@ public class ApiManager { try { - IEnumerable? mappings = device.GetAllMappingsAsync().GetAwaiter().GetResult(); - foreach (Mapping? mapping in mappings) - { - if (mapping.Description.Contains("HyperbolicDowloader") && mapping.PrivateIP.ToString() == portMapping?.PrivateIP.ToString()) - { - device.DeletePortMapAsync(mapping).GetAwaiter().GetResult(); - } - } + device.DeletePortMapAsync(portMapping).GetAwaiter().GetResult(); } catch (Exception ex) {