check installer correctly

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-09-23 17:35:03 +03:00
parent e501279b91
commit 2ee85d2e64
6 changed files with 11 additions and 9 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ public interface IAzaionApi
{
void Login(ApiCredentials credentials);
Task<string> GetLastInstallerName(string folder);
Task<(string name, Stream stream)> DownloadInstaller(string folder);
Task<(string name, Stream stream)> DownloadInstaller(bool isStage = false);
}
public class AzaionApi(HttpClient client) : IAzaionApi
@@ -31,9 +31,9 @@ public class AzaionApi(HttpClient client) : IAzaionApi
return res?.FirstOrDefault() ?? "";
}
public async Task<(string name, Stream stream)> DownloadInstaller(string folder)
public async Task<(string name, Stream stream)> DownloadInstaller(bool isStage = false)
{
var response = await Send(new HttpRequestMessage(HttpMethod.Get, $"resources/get-installer/{folder}"));
var response = await Send(new HttpRequestMessage(HttpMethod.Get, $"resources/get-installer/{isStage}"));
var fileStream = await response.Content.ReadAsStreamAsync();
var fileName = response.Content.Headers.ContentDisposition?.FileName?.Trim('"') ?? "installer.exe";
return (fileName, fileStream);