This commit is contained in:
kramo
2023-04-18 02:31:44 +02:00
parent 741245b415
commit f8bb111939
7 changed files with 108 additions and 163 deletions

View File

@@ -332,7 +332,7 @@ def create_details_window(win, game_id=None):
else:
save_game(win, values)
win.update_games([game_id])
win.update_games({game_id})
if not game_cover.get_pixbuf():
SGDBSave(win, {(game_id, values["name"])})

View File

@@ -23,17 +23,15 @@ import json
def get_games(win, game_ids=None):
games = {}
if not win.games_dir.exists():
return {}
game_files = (
[win.games_dir / f"{game_id}.json" for game_id in game_ids]
{win.games_dir / f"{game_id}.json" for game_id in game_ids}
if game_ids
else win.games_dir.iterdir()
)
for open_file in game_files:
data = json.load(open_file.open())
games[data["game_id"]] = data
if open_file.exists():
data = json.load(open_file.open())
games[data["game_id"]] = data
return games

View File

@@ -112,7 +112,7 @@ class SGDBSave:
).connect("response", self.response)
game_id = result.propagate_value()[1]
self.win.update_games([game_id])
self.win.update_games({game_id})
def response(self, _widget, response):
if response == "open_preferences":