diff --git a/.gitignore b/.gitignore
index 88a2974..0f34f01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -554,4 +554,4 @@ MigrationBackup/
# End of https://www.toptal.com/developers/gitignore/api/visualstudio,jetbrains,windows,visualstudiocode,rider,dotnetcore
ConsoleApp1/
-/Utils/CsRinRuLogin.cs
+/Utils/Secrets.cs
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 4a142fc..3ca06e5 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -48,8 +48,7 @@
-
-
-
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 64f4fa8..0049424 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Windows;
using System.Windows.Input;
using auto_creamapi.Model;
+using auto_creamapi.Utils;
using Microsoft.Win32;
namespace auto_creamapi
@@ -99,13 +100,20 @@ namespace auto_creamapi
{
if (int.TryParse(AppId.Text, out var appId))
{
- var app = new POCOs.App() {AppId = appId, Name = Game.Text};
- var listOfDlc = await _cacheModel.GetListOfDlc(app,
- SteamDb.IsChecked != null && (bool) SteamDb.IsChecked);
- var result = "";
- listOfDlc.Sort((app1, app2) => app1.AppId.CompareTo(app2.AppId));
- listOfDlc.ForEach(x => result += $"{x.AppId}={x.Name}\n");
- ListOfDlcs.Text = result;
+ if (appId > 0)
+ {
+ var app = new POCOs.App() {AppId = appId, Name = Game.Text};
+ var listOfDlc = await _cacheModel.GetListOfDlc(app,
+ SteamDb.IsChecked != null && (bool) SteamDb.IsChecked);
+ var result = "";
+ listOfDlc.Sort((app1, app2) => app1.AppId.CompareTo(app2.AppId));
+ listOfDlc.ForEach(x => result += $"{x.AppId}={x.Name}\n");
+ ListOfDlcs.Text = result;
+ }
+ else
+ {
+ MyLogger.Log.Error($"GetListOfDlc: Invalid AppID {appId}");
+ }
}
}
@@ -154,8 +162,22 @@ namespace auto_creamapi
{
if (int.TryParse(AppId.Text, out var appId))
{
- var app = _cacheModel.GetAppById(appId);
- if (app != null) Game.Text = app.Name;
+ if (appId > 0)
+ {
+ var app = _cacheModel.GetAppById(appId);
+ if (app != null)
+ {
+ Game.Text = app.Name;
+ }
+ else
+ {
+ MyLogger.Log.Error($"No app found for ID {appId}");
+ }
+ }
+ else
+ {
+ MyLogger.Log.Error($"SetNameById: Invalid AppID {appId}");
+ }
}
}
diff --git a/Model/CreamDllModel.cs b/Model/CreamDllModel.cs
index 7e7d046..2d38cfe 100644
--- a/Model/CreamDllModel.cs
+++ b/Model/CreamDllModel.cs
@@ -57,7 +57,7 @@ namespace auto_creamapi.Model
if (!(File.Exists("steam_api.dll") && File.Exists("steam_api64.dll")))
{
MyLogger.Log.Information("Missing files, trying to download...");
- new Action(async() => await DownloadDll(CsRinRuLogin.Username, CsRinRuLogin.Password))();
+ new Action(async() => await DownloadDll(Secrets.ForumUsername, Secrets.ForumPassword))();
}
else
{
diff --git a/Utils/CsRinRuLogin.EXAMPLE.cs b/Utils/Secrets.EXAMPLE.cs
similarity index 65%
rename from Utils/CsRinRuLogin.EXAMPLE.cs
rename to Utils/Secrets.EXAMPLE.cs
index 4476ff9..06fcee6 100644
--- a/Utils/CsRinRuLogin.EXAMPLE.cs
+++ b/Utils/Secrets.EXAMPLE.cs
@@ -2,10 +2,11 @@ namespace auto_creamapi.Utils
{
///
/// To use this:
- /// Rename CsRinRuLogin_REMOVETHIS to CsRinRuLogin
+ /// Rename file Secrets.EXAMPLE.cs to Secrets.cs
+ /// Rename class Secrets_REMOVETHIS to Secrets
/// Enter the relevant info below
///
- public class CsRinRuLogin_REMOVETHIS
+ public class Secrets_REMOVETHIS
{
public const string Username = "Enter username here";
public const string Password = "Enter password here";