From 244172fd0f08c104878f964ee9891a7b58e9c92a Mon Sep 17 00:00:00 2001 From: Panikorovskii Vladislav <68610520+bladuk@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:20:44 +0300 Subject: [PATCH] `[EXILED::Events]` Fix downloading NWAPI plugins with `hub install` (#117) --- EXILED/Exiled.Events/Commands/Hub/Install.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Events/Commands/Hub/Install.cs b/EXILED/Exiled.Events/Commands/Hub/Install.cs index bdcd7e18f..b1d7e7e10 100644 --- a/EXILED/Exiled.Events/Commands/Hub/Install.cs +++ b/EXILED/Exiled.Events/Commands/Hub/Install.cs @@ -89,9 +89,11 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s releaseToDownload = foundRelease; } - Log.Info($"Downloading release \"{releaseToDownload.TagName}\". Found {releaseToDownload.Assets.Length} asset(s) to download."); + ReleaseAsset[] releaseAssets = releaseToDownload.Assets.Where(x => x.Name.IndexOf("nwapi", StringComparison.OrdinalIgnoreCase) == -1).ToArray(); - foreach (ReleaseAsset asset in releaseToDownload.Assets) + Log.Info($"Downloading release \"{releaseToDownload.TagName}\". Found {releaseAssets.Length} asset(s) to download."); + + foreach (ReleaseAsset asset in releaseAssets) { Log.Info($"Downloading asset {asset.Name}. Asset size: {Math.Round(asset.Size / 1000f, 2)} KB."); using HttpResponseMessage assetResponse = client.GetAsync(asset.BrowserDownloadUrl).ConfigureAwait(false).GetAwaiter().GetResult();