From 3bee1a5508cb59fbd38f3d2333f1f538b891137c Mon Sep 17 00:00:00 2001 From: Jeddunk Date: Sun, 21 Mar 2021 16:15:17 +0100 Subject: [PATCH] minor changes --- GoldbergGUI.Core/Services/GoldbergService.cs | 2 -- GoldbergGUI.Core/Services/SteamService.cs | 12 ++++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/GoldbergGUI.Core/Services/GoldbergService.cs b/GoldbergGUI.Core/Services/GoldbergService.cs index 299ba96..81fec86 100644 --- a/GoldbergGUI.Core/Services/GoldbergService.cs +++ b/GoldbergGUI.Core/Services/GoldbergService.cs @@ -23,8 +23,6 @@ namespace GoldbergGUI.Core.Services public Task GetGlobalSettings(); public Task SetGlobalSettings(GoldbergGlobalConfiguration configuration); public bool GoldbergApplied(string path); - // public Task Download(); - // public Task Extract(string archivePath); public Task GenerateInterfacesFile(string filePath); public List Languages(); } diff --git a/GoldbergGUI.Core/Services/SteamService.cs b/GoldbergGUI.Core/Services/SteamService.cs index 7b8e338..d16c9db 100644 --- a/GoldbergGUI.Core/Services/SteamService.cs +++ b/GoldbergGUI.Core/Services/SteamService.cs @@ -82,7 +82,7 @@ namespace GoldbergGUI.Core.Services private const string AppTypeGame = "game"; private const string AppTypeDlc = "dlc"; - private const string Database = "steamapps.db"; + private const string Database = "steamapps.cache"; private IMvxLog _log; @@ -90,7 +90,6 @@ namespace GoldbergGUI.Core.Services public async Task Initialize(IMvxLog log) { - //var (path, uri, jsonType, appType) = _caches[0]; static SteamApps DeserializeSteamApps(Type type, string cacheString) { return type == typeof(SteamAppsV2) @@ -128,7 +127,7 @@ namespace GoldbergGUI.Core.Services foreach (var steamApp in cacheRaw) { steamApp.type = steamCache.SteamAppType; - steamApp.ComparableName = Regex.Replace(steamApp.Name, Misc.AlphaNumOnlyRegex, "").ToLower(); + steamApp.ComparableName = PrepareStringToCompare(steamApp.Name); cache.Add(steamApp); } @@ -149,7 +148,7 @@ namespace GoldbergGUI.Core.Services public SteamApp GetAppByName(string name) { _log.Info($"Trying to get app {name}"); - var comparableName = Regex.Replace(name, Misc.AlphaNumOnlyRegex, "").ToLower(); + var comparableName = PrepareStringToCompare(name); var app = _db.Table() .FirstOrDefault(x => x.type == AppTypeGame && x.ComparableName.Equals(comparableName)); if (app != null) _log.Info($"Successfully got app {app}"); @@ -256,5 +255,10 @@ namespace GoldbergGUI.Core.Services return dlcList; } + + private static string PrepareStringToCompare(string name) + { + return Regex.Replace(name, Misc.AlphaNumOnlyRegex, "").ToLower(); + } } } \ No newline at end of file