From f85f246a264f0abf0939d408e09ef8229d3ae1c1 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:51:03 +1100 Subject: [PATCH] Include ROM's without a signature match in rematcher efforts (#191) * Include ROM's without a signature match in rematcher efforts * Rematcher will now execute on all titles if manually started --- gaseous-server/Classes/ImportGames.cs | 14 +++++++++++--- gaseous-server/ProcessQueue.cs | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gaseous-server/Classes/ImportGames.cs b/gaseous-server/Classes/ImportGames.cs index 97ea9f4..4fbf27e 100644 --- a/gaseous-server/Classes/ImportGames.cs +++ b/gaseous-server/Classes/ImportGames.cs @@ -746,15 +746,23 @@ namespace gaseous_server.Classes } } - public static void Rematcher() + public static void Rematcher(bool ForceExecute = false) { // rescan all titles with an unknown platform or title and see if we can get a match Logging.Log(Logging.LogType.Information, "Rematch Scan", "Rematch scan starting"); Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); - string sql = "SELECT * FROM Games_Roms WHERE (PlatformId = 0 OR GameId = 0) AND (LastMatchAttemptDate IS NULL OR LastMatchAttemptDate < @lastmatchattemptdate) LIMIT 100;"; + string sql = ""; + if (ForceExecute == false) + { + sql = "SELECT * FROM Games_Roms WHERE (PlatformId = 0 OR GameId = 0 OR MetaddataSource = 0) AND (LastMatchAttemptDate IS NULL OR LastMatchAttemptDate < @lastmatchattemptdate) LIMIT 100;"; + } + else + { + sql = "SELECT * FROM Games_Roms WHERE (PlatformId = 0 OR GameId = 0 OR MetaddataSource = 0);"; + } Dictionary dbDict = new Dictionary(); - dbDict.Add("lastmatchattemptdate", DateTime.UtcNow.AddMonths(-1)); + dbDict.Add("lastmatchattemptdate", DateTime.UtcNow.AddDays(-7)); DataTable data = db.ExecuteCMD(sql, dbDict); foreach (DataRow row in data.Rows) { diff --git a/gaseous-server/ProcessQueue.cs b/gaseous-server/ProcessQueue.cs index d209d2f..9a73fe0 100644 --- a/gaseous-server/ProcessQueue.cs +++ b/gaseous-server/ProcessQueue.cs @@ -148,7 +148,7 @@ namespace gaseous_server case QueueItemType.Rematcher: Logging.Log(Logging.LogType.Debug, "Timered Event", "Starting Rematch"); - Classes.ImportGame.Rematcher(); + Classes.ImportGame.Rematcher(_ForceExecute); _SaveLastRunTime = true;