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;