Cleanups
This commit is contained in:
@@ -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"])})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user