mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
check installer correctly
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user