From 99786a0c36d0d1be3a9ee12c2af7cf3275e84a79 Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Thu, 12 May 2022 22:06:42 +0200 Subject: [PATCH] added configureawait false to achievement method --- GoldbergGUI.Core/App.cs | 1 - GoldbergGUI.Core/Services/GoldbergService.cs | 6 +++--- GoldbergGUI.Core/Services/SteamService.cs | 2 +- GoldbergGUI.Core/ViewModels/MainViewModel.cs | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/GoldbergGUI.Core/App.cs b/GoldbergGUI.Core/App.cs index 695c2f8..42fce81 100644 --- a/GoldbergGUI.Core/App.cs +++ b/GoldbergGUI.Core/App.cs @@ -13,7 +13,6 @@ namespace GoldbergGUI.Core .EndingWith("Service") .AsInterfaces() .RegisterAsLazySingleton(); - //RegisterAppStart(); RegisterCustomAppStart>(); } } diff --git a/GoldbergGUI.Core/Services/GoldbergService.cs b/GoldbergGUI.Core/Services/GoldbergService.cs index 40bca24..c8d1c30 100644 --- a/GoldbergGUI.Core/Services/GoldbergService.cs +++ b/GoldbergGUI.Core/Services/GoldbergService.cs @@ -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); } } } \ No newline at end of file diff --git a/GoldbergGUI.Core/Services/SteamService.cs b/GoldbergGUI.Core/Services/SteamService.cs index c457000..a54c264 100644 --- a/GoldbergGUI.Core/Services/SteamService.cs +++ b/GoldbergGUI.Core/Services/SteamService.cs @@ -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); diff --git a/GoldbergGUI.Core/ViewModels/MainViewModel.cs b/GoldbergGUI.Core/ViewModels/MainViewModel.cs index 666401a..177f4f2 100644 --- a/GoldbergGUI.Core/ViewModels/MainViewModel.cs +++ b/GoldbergGUI.Core/ViewModels/MainViewModel.cs @@ -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(listOfAchievements); MainWindowEnabled = true;