From a7efe0a92085db295bfe1572e3d7f2cff85241c9 Mon Sep 17 00:00:00 2001 From: GeoffreyCoulaud Date: Sat, 1 Jul 2023 03:01:15 +0200 Subject: [PATCH] Removed allow_side_effects --- src/details_window.py | 3 +-- src/game.py | 2 +- src/importer/sources/bottles_source.py | 2 +- src/importer/sources/flatpak_source.py | 2 +- src/importer/sources/heroic_source.py | 2 +- src/importer/sources/itch_source.py | 2 +- src/importer/sources/legendary_source.py | 2 +- src/importer/sources/lutris_source.py | 2 +- src/importer/sources/steam_source.py | 2 +- src/main.py | 2 +- 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/details_window.py b/src/details_window.py index dd7267b..85b7116 100644 --- a/src/details_window.py +++ b/src/details_window.py @@ -169,8 +169,7 @@ class DetailsWindow(Adw.Window): "hidden": False, "source": "imported", "added": int(time()), - }, - allow_side_effects=False, + } ) else: diff --git a/src/game.py b/src/game.py index 25694a9..e4b7693 100644 --- a/src/game.py +++ b/src/game.py @@ -61,7 +61,7 @@ class Game(Gtk.Box): game_cover = None version = 0 - def __init__(self, data, allow_side_effects=True, **kwargs): + def __init__(self, data, **kwargs): super().__init__(**kwargs) self.win = shared.win diff --git a/src/importer/sources/bottles_source.py b/src/importer/sources/bottles_source.py index 01e504b..2905fb3 100644 --- a/src/importer/sources/bottles_source.py +++ b/src/importer/sources/bottles_source.py @@ -54,7 +54,7 @@ class BottlesSourceIterator(SourceIterator): bottle_name=entry["bottle"]["name"], game_name=entry["name"] ), } - game = Game(values, allow_side_effects=False) + game = Game(values) # Get official cover path try: diff --git a/src/importer/sources/flatpak_source.py b/src/importer/sources/flatpak_source.py index 0609dae..c8f375e 100644 --- a/src/importer/sources/flatpak_source.py +++ b/src/importer/sources/flatpak_source.py @@ -100,7 +100,7 @@ class FlatpakSourceIterator(SourceIterator): flatpak_id=flatpak_id ), } - game = Game(values, allow_side_effects=False) + game = Game(values) additional_data = {} if icon_name := desktop_values["Icon"]: diff --git a/src/importer/sources/heroic_source.py b/src/importer/sources/heroic_source.py index a5583ed..ed501c2 100644 --- a/src/importer/sources/heroic_source.py +++ b/src/importer/sources/heroic_source.py @@ -90,7 +90,7 @@ class HeroicSourceIterator(SourceIterator): ), "executable": self.source.executable_format.format(app_name=app_name), } - game = Game(values, allow_side_effects=False) + game = Game(values) # Get the image path from the heroic cache # Filenames are derived from the URL that heroic used to get the file diff --git a/src/importer/sources/itch_source.py b/src/importer/sources/itch_source.py index 4c6cd23..0b11dcb 100644 --- a/src/importer/sources/itch_source.py +++ b/src/importer/sources/itch_source.py @@ -71,7 +71,7 @@ class ItchSourceIterator(SourceIterator): "executable": self.source.executable_format.format(cave_id=row[4]), } additional_data = {"online_cover_url": row[3] or row[2]} - game = Game(values, allow_side_effects=False) + game = Game(values) yield (game, additional_data) # Cleanup diff --git a/src/importer/sources/legendary_source.py b/src/importer/sources/legendary_source.py index 65758b4..496a742 100644 --- a/src/importer/sources/legendary_source.py +++ b/src/importer/sources/legendary_source.py @@ -62,7 +62,7 @@ class LegendarySourceIterator(SourceIterator): except (JSONDecodeError, OSError, KeyError): pass - game = Game(values, allow_side_effects=False) + game = Game(values) return (game, data) def generator_builder(self) -> Generator[SourceIterationResult, None, None]: diff --git a/src/importer/sources/lutris_source.py b/src/importer/sources/lutris_source.py index f9a384e..17e4956 100644 --- a/src/importer/sources/lutris_source.py +++ b/src/importer/sources/lutris_source.py @@ -74,7 +74,7 @@ class LutrisSourceIterator(SourceIterator): ), "executable": self.source.executable_format.format(game_id=row[2]), } - game = Game(values, allow_side_effects=False) + game = Game(values) # Get official image path image_path = self.source.cache_location["coverart"] / f"{row[2]}.jpg" diff --git a/src/importer/sources/steam_source.py b/src/importer/sources/steam_source.py index 5b7820c..13d99a7 100644 --- a/src/importer/sources/steam_source.py +++ b/src/importer/sources/steam_source.py @@ -96,7 +96,7 @@ class SteamSourceIterator(SourceIterator): "game_id": self.source.game_id_format.format(game_id=appid), "executable": self.source.executable_format.format(game_id=appid), } - game = Game(values, allow_side_effects=False) + game = Game(values) # Add official cover image image_path = ( diff --git a/src/main.py b/src/main.py index 262a1b9..d0afd3e 100644 --- a/src/main.py +++ b/src/main.py @@ -138,7 +138,7 @@ class CartridgesApplication(Adw.Application): if shared.games_dir.is_dir(): for game_file in shared.games_dir.iterdir(): data = json.load(game_file.open()) - game = Game(data, allow_side_effects=False) + game = Game(data) shared.store.add_game(game, {"skip_save": True}) def on_about_action(self, *_args):