private async Task DownloadAsync() { using (var client = _httpClientFactory.GetHttpFileDownload()) { await client.DownloadAsync(_walletConfig.UserConfig.BootstrapUrl, _bootstrapFilePath, (x) => { var progressBar = BoxsieUtils.CreateProgressBar(x.Percent, 50); Console.Write(x.Percent < 100 ? $"\rDownloading bootstrap.. {progressBar} {Math.Round(x.Percent, 3):N3}% {x.MegabytesPerSecond:N3}Mb/s {x.RemainingTime:hh\\:mm\\:ss} remaining " : $"\rDownloading bootstrap.. {progressBar} {Math.Round(x.Percent, 3):N3}% {TimeSpan.FromSeconds(x.TotalSeconds):hh\\:mm\\:ss} complete "); });
private async Task DownloadAsync() { var platform = BoxsieUtils.GetPlatform(); var url = _walletConfig.UserConfig.InstallerUrls[platform]; var filePath = Path.Combine(_walletInstallerPath, WalletUtils.GetWalletExecuteableFilename()); using (var client = _httpClientFactory.GetHttpFileDownload()) { await client.DownloadAsync(url, filePath, (x) => { var progressBar = BoxsieUtils.CreateProgressBar(x.Percent, 50); Console.Write(x.Percent < 100 ? $"\rDownloading installer.. {progressBar} {Math.Round(x.Percent, 3):N3}% {x.MegabytesPerSecond:N3}Mb/s {x.RemainingTime:hh\\:mm\\:ss} remaining " : $"\rDownloading installer.. {progressBar} {Math.Round(x.Percent, 3):N3}% {TimeSpan.FromSeconds(x.TotalSeconds):hh\\:mm\\:ss} complete "); });