From a4d143825c0344fccfe5a71f06147ce149330e10 Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Sun, 21 Mar 2021 13:00:58 +0100 Subject: [PATCH] Revert 89f43166 --- GoldbergGUI.Core/Models/SteamAppModel.cs | 2 +- GoldbergGUI.Core/Services/SteamService.cs | 4 ++-- GoldbergGUI.Core/ViewModels/MainViewModel.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GoldbergGUI.Core/Models/SteamAppModel.cs b/GoldbergGUI.Core/Models/SteamAppModel.cs index d8b2b26..6fbf277 100644 --- a/GoldbergGUI.Core/Models/SteamAppModel.cs +++ b/GoldbergGUI.Core/Models/SteamAppModel.cs @@ -79,7 +79,7 @@ namespace GoldbergGUI.Core.Models public class AppType { - public AppType(string value) => Value = value; + private AppType(string value) => Value = value; public string Value { get; } diff --git a/GoldbergGUI.Core/Services/SteamService.cs b/GoldbergGUI.Core/Services/SteamService.cs index 64c523c..b197912 100644 --- a/GoldbergGUI.Core/Services/SteamService.cs +++ b/GoldbergGUI.Core/Services/SteamService.cs @@ -179,18 +179,18 @@ namespace GoldbergGUI.Core.Services var steamAppDetails = await task.ConfigureAwait(true); if (steamAppDetails.Type == AppType.Game.Value) { - var db = new LiteDatabase("steamapps.db"); steamAppDetails.DLC.ForEach(x => { /*var result = _caches[AppType.DLC].Cache.FirstOrDefault(y => y.AppId.Equals(x)) ?? new SteamApp {AppId = x, Name = $"Unknown DLC {x}"};*/ + + using var db = new LiteDatabase("steamapps.db"); var steamAppCollection = db.GetCollection("steamapps"); steamAppCollection.EnsureIndex(y => y.AppId); var result = steamAppCollection.FindOne(y => y.AppId.Equals(x)) ?? new SteamApp {AppId = x, Name = $"Unknown DLC {x}"}; dlcList.Add(result); }); - db.Dispose(); dlcList.ForEach(x => _log.Debug($"{x.AppId}={x.Name}")); _log.Info("Got DLC successfully..."); diff --git a/GoldbergGUI.Core/ViewModels/MainViewModel.cs b/GoldbergGUI.Core/ViewModels/MainViewModel.cs index 2e2e2f6..ef36c1d 100644 --- a/GoldbergGUI.Core/ViewModels/MainViewModel.cs +++ b/GoldbergGUI.Core/ViewModels/MainViewModel.cs @@ -292,7 +292,7 @@ namespace GoldbergGUI.Core.ViewModels DllPath = dialog.FileName; await ReadConfig().ConfigureAwait(false); - // if (!GoldbergApplied) await GetListOfDlc().ConfigureAwait(false); + if (!GoldbergApplied) await GetListOfDlc().ConfigureAwait(false); MainWindowEnabled = true; StatusText = "Ready."; } @@ -349,7 +349,7 @@ namespace GoldbergGUI.Core.ViewModels await FindIdInList(steamApps).ConfigureAwait(false); } } - //await GetListOfDlc().ConfigureAwait(false); + await GetListOfDlc().ConfigureAwait(false); MainWindowEnabled = true; StatusText = "Ready."; }