added configureawait false to achievement method

This commit is contained in:
Jeddunk 2022-05-12 22:06:42 +02:00
parent 6518361824
commit 99786a0c36
4 changed files with 6 additions and 7 deletions

View File

@ -13,7 +13,6 @@ namespace GoldbergGUI.Core
.EndingWith("Service")
.AsInterfaces()
.RegisterAsLazySingleton();
//RegisterAppStart<MainViewModel>();
RegisterCustomAppStart<CustomMvxAppStart<MainViewModel>>();
}
}

View File

@ -327,8 +327,8 @@ namespace GoldbergGUI.Core.Services
foreach (var achievement in c.Achievements)
{
await DownloadImageAsync(imagePath, achievement.Icon);
await DownloadImageAsync(imagePath, achievement.IconGray);
await DownloadImageAsync(imagePath, achievement.Icon).ConfigureAwait(false);
await DownloadImageAsync(imagePath, achievement.IconGray).ConfigureAwait(false);
// Update achievement list to point to local images instead
achievement.Icon = $"images/{Path.GetFileName(achievement.Icon)}";
@ -698,7 +698,7 @@ namespace GoldbergGUI.Core.Services
}
var wc = new System.Net.WebClient();
await wc.DownloadFileTaskAsync(new Uri(imageUrl, UriKind.Absolute), targetPath);
await wc.DownloadFileTaskAsync(new Uri(imageUrl, UriKind.Absolute), targetPath).ConfigureAwait(false);
}
}
}

View File

@ -184,7 +184,7 @@ namespace GoldbergGUI.Core.Services
client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgent);
var apiUrl = $"{GameSchemaUrl}?key={Secrets.SteamWebApiKey()}&appid={steamApp.AppId}&l=en";
var response = await client.GetAsync(apiUrl);
var response = await client.GetAsync(apiUrl).ConfigureAwait(false);
var responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var jsonResponse = JsonDocument.Parse(responseBody);

View File

@ -259,7 +259,7 @@ namespace GoldbergGUI.Core.ViewModels
{
_selectedLanguage = value;
RaisePropertyChanged(() => SelectedLanguage);
//MyLogger.Log.Debug($"Lang: {value}");
//_log.LogDebug($"Lang: {value}");
}
}
@ -391,7 +391,7 @@ namespace GoldbergGUI.Core.ViewModels
MainWindowEnabled = false;
StatusText = "Trying to get list of achievements...";
var listOfAchievements = await _steam.GetListOfAchievements(new SteamApp { AppId = AppId, Name = GameName });
var listOfAchievements = await _steam.GetListOfAchievements(new SteamApp { AppId = AppId, Name = GameName }).ConfigureAwait(false);
Achievements = new MvxObservableCollection<Achievement>(listOfAchievements);
MainWindowEnabled = true;