From ad448d1bed5642453d7d8221486bd4a8bfbe75f5 Mon Sep 17 00:00:00 2001 From: KubaPro010 <132459354+KubaPro010@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:31:24 +0100 Subject: [PATCH] prepare then execute --- radioPlayer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radioPlayer.py b/radioPlayer.py index 9db7859..25b7c1c 100644 --- a/radioPlayer.py +++ b/radioPlayer.py @@ -225,6 +225,7 @@ def play_playlist(playlist_path: Path, starting_index: int = 0): def main(): logger.info("Core is starting, loading modules") global playlist_advisor, active_modifier + modules: list[tuple] = [] for file in MODULES_DIR.glob("*"): if file.name.endswith(".py") and file.name != "__init__.py": module_name = file.name[:-3] @@ -245,7 +246,9 @@ def main(): module._log_file = log_file # type: ignore module.__dict__['_log_file'] = log_file - + modules.append((spec, module, module_name)) + + for (spec, module, module_name) in modules: if not spec.loader: continue try: spec.loader.exec_module(module) except Exception as e: