🎨 Reorganized game loading from disk

This commit is contained in:
GeoffreyCoulaud
2023-05-24 17:08:34 +02:00
parent 8026c41886
commit 7220852291
8 changed files with 32 additions and 14 deletions

View File

@@ -59,13 +59,13 @@ class Game(Gtk.Box):
removed = None
blacklisted = None
game_cover = None
version = None
def __init__(self, data, allow_side_effects=True, **kwargs):
super().__init__(**kwargs)
self.win = shared.win
self.app = self.win.get_application()
self.version = shared.spec_version
self.update_values(data)
@@ -145,13 +145,6 @@ class Game(Gtk.Box):
"version",
)
# TODO: remove for 2.0
attrs = list(attrs)
if not self.removed:
attrs.remove("removed")
if not self.blacklisted:
attrs.remove("blacklisted")
json.dump(
{attr: getattr(self, attr) for attr in attrs if attr},
(shared.games_dir / f"{self.game_id}.json").open("w"),