Removed allow_side_effects

This commit is contained in:
GeoffreyCoulaud
2023-07-01 03:01:15 +02:00
parent 8d082ab158
commit a7efe0a920
10 changed files with 10 additions and 11 deletions

View File

@@ -169,8 +169,7 @@ class DetailsWindow(Adw.Window):
"hidden": False, "hidden": False,
"source": "imported", "source": "imported",
"added": int(time()), "added": int(time()),
}, }
allow_side_effects=False,
) )
else: else:

View File

@@ -61,7 +61,7 @@ class Game(Gtk.Box):
game_cover = None game_cover = None
version = 0 version = 0
def __init__(self, data, allow_side_effects=True, **kwargs): def __init__(self, data, **kwargs):
super().__init__(**kwargs) super().__init__(**kwargs)
self.win = shared.win self.win = shared.win

View File

@@ -54,7 +54,7 @@ class BottlesSourceIterator(SourceIterator):
bottle_name=entry["bottle"]["name"], game_name=entry["name"] bottle_name=entry["bottle"]["name"], game_name=entry["name"]
), ),
} }
game = Game(values, allow_side_effects=False) game = Game(values)
# Get official cover path # Get official cover path
try: try:

View File

@@ -100,7 +100,7 @@ class FlatpakSourceIterator(SourceIterator):
flatpak_id=flatpak_id flatpak_id=flatpak_id
), ),
} }
game = Game(values, allow_side_effects=False) game = Game(values)
additional_data = {} additional_data = {}
if icon_name := desktop_values["Icon"]: if icon_name := desktop_values["Icon"]:

View File

@@ -90,7 +90,7 @@ class HeroicSourceIterator(SourceIterator):
), ),
"executable": self.source.executable_format.format(app_name=app_name), "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 # Get the image path from the heroic cache
# Filenames are derived from the URL that heroic used to get the file # Filenames are derived from the URL that heroic used to get the file

View File

@@ -71,7 +71,7 @@ class ItchSourceIterator(SourceIterator):
"executable": self.source.executable_format.format(cave_id=row[4]), "executable": self.source.executable_format.format(cave_id=row[4]),
} }
additional_data = {"online_cover_url": row[3] or row[2]} additional_data = {"online_cover_url": row[3] or row[2]}
game = Game(values, allow_side_effects=False) game = Game(values)
yield (game, additional_data) yield (game, additional_data)
# Cleanup # Cleanup

View File

@@ -62,7 +62,7 @@ class LegendarySourceIterator(SourceIterator):
except (JSONDecodeError, OSError, KeyError): except (JSONDecodeError, OSError, KeyError):
pass pass
game = Game(values, allow_side_effects=False) game = Game(values)
return (game, data) return (game, data)
def generator_builder(self) -> Generator[SourceIterationResult, None, None]: def generator_builder(self) -> Generator[SourceIterationResult, None, None]:

View File

@@ -74,7 +74,7 @@ class LutrisSourceIterator(SourceIterator):
), ),
"executable": self.source.executable_format.format(game_id=row[2]), "executable": self.source.executable_format.format(game_id=row[2]),
} }
game = Game(values, allow_side_effects=False) game = Game(values)
# Get official image path # Get official image path
image_path = self.source.cache_location["coverart"] / f"{row[2]}.jpg" image_path = self.source.cache_location["coverart"] / f"{row[2]}.jpg"

View File

@@ -96,7 +96,7 @@ class SteamSourceIterator(SourceIterator):
"game_id": self.source.game_id_format.format(game_id=appid), "game_id": self.source.game_id_format.format(game_id=appid),
"executable": self.source.executable_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 # Add official cover image
image_path = ( image_path = (

View File

@@ -138,7 +138,7 @@ class CartridgesApplication(Adw.Application):
if shared.games_dir.is_dir(): if shared.games_dir.is_dir():
for game_file in shared.games_dir.iterdir(): for game_file in shared.games_dir.iterdir():
data = json.load(game_file.open()) data = json.load(game_file.open())
game = Game(data, allow_side_effects=False) game = Game(data)
shared.store.add_game(game, {"skip_save": True}) shared.store.add_game(game, {"skip_save": True})
def on_about_action(self, *_args): def on_about_action(self, *_args):