fix: added early breakout from game search if the title is found

This commit is contained in:
Michael Green
2023-06-29 09:29:23 +10:00
parent 495c39f2dd
commit e86aa80df6

View File

@@ -199,6 +199,7 @@ namespace gaseous_server.Classes
foreach (string SearchCandidate in SearchCandidates) foreach (string SearchCandidate in SearchCandidates)
{ {
bool GameFound = false;
Logging.Log(Logging.LogType.Information, "Import Game", " Searching for title: " + SearchCandidate); Logging.Log(Logging.LogType.Information, "Import Game", " Searching for title: " + SearchCandidate);
@@ -211,6 +212,7 @@ namespace gaseous_server.Classes
// exact match! // exact match!
determinedGame = Metadata.Games.GetGame((long)games[0].Id, false, false); determinedGame = Metadata.Games.GetGame((long)games[0].Id, false, false);
Logging.Log(Logging.LogType.Information, "Import Game", " IGDB game: " + determinedGame.Name); Logging.Log(Logging.LogType.Information, "Import Game", " IGDB game: " + determinedGame.Name);
GameFound = true;
break; break;
} }
else if (games.Length > 0) else if (games.Length > 0)
@@ -222,6 +224,7 @@ namespace gaseous_server.Classes
Logging.Log(Logging.LogType.Information, "Import Game", " No search results found"); Logging.Log(Logging.LogType.Information, "Import Game", " No search results found");
} }
} }
if (GameFound == true) { break; }
} }
if (determinedGame == null) if (determinedGame == null)
{ {