Match installed games by configpath (Closes #1712)

This commit is contained in:
Mathieu Comandon 2019-02-07 13:20:54 -08:00
parent e7471193c4
commit 6dae319d77

View file

@ -294,12 +294,13 @@ def get_matching_game(params):
if not slug:
raise ValueError("Can't add or update without an identifier")
for game in get_games_by_slug(slug):
if game["installed"]:
if game["configpath"] == params.get("configpath"):
return game["id"]
else:
if (
(
game["runner"] == params.get("runner")
or not all([params.get("runner"), game["runner"]])
)
and not game["installed"]
):
return game["id"]
return None