From 40dacf5a51202ed96f40993174ba9ed1bdea318b Mon Sep 17 00:00:00 2001 From: KubaPro010 <132459354+KubaPro010@users.noreply.github.com> Date: Sat, 8 Nov 2025 21:45:08 +0100 Subject: [PATCH] oh shit --- radioPlayer.py | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/radioPlayer.py b/radioPlayer.py index 25b7c1c..e300ef8 100644 --- a/radioPlayer.py +++ b/radioPlayer.py @@ -248,30 +248,30 @@ def main(): 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: - traceback.print_exc() - logger.error(f"Failed loading {module_name} due to {e}") - continue + for (spec, module, module_name) in modules: + if not spec.loader: continue + try: spec.loader.exec_module(module) + except Exception as e: + traceback.print_exc() + logger.error(f"Failed loading {module_name} due to {e}") + continue - if md := getattr(module, "module", None): - if isinstance(md, list): simple_modules.extend(md) - else: simple_modules.append(md) - if md := getattr(module, "playlistmod", None): - if isinstance(md, tuple): - md, index = md - if isinstance(md, list): playlist_modifier_modules[index:index] = md - else: playlist_modifier_modules.insert(index, md) - elif isinstance(md, list): playlist_modifier_modules.extend(md) - else: playlist_modifier_modules.append(md) - if md := getattr(module, "advisor", None): - if playlist_advisor: raise Exception("Multiple playlist advisors") - playlist_advisor = md - if md := getattr(module, "activemod", None): - if active_modifier: raise Exception("Multiple active modifiers") - active_modifier = md + if md := getattr(module, "module", None): + if isinstance(md, list): simple_modules.extend(md) + else: simple_modules.append(md) + if md := getattr(module, "playlistmod", None): + if isinstance(md, tuple): + md, index = md + if isinstance(md, list): playlist_modifier_modules[index:index] = md + else: playlist_modifier_modules.insert(index, md) + elif isinstance(md, list): playlist_modifier_modules.extend(md) + else: playlist_modifier_modules.append(md) + if md := getattr(module, "advisor", None): + if playlist_advisor: raise Exception("Multiple playlist advisors") + playlist_advisor = md + if md := getattr(module, "activemod", None): + if active_modifier: raise Exception("Multiple active modifiers") + active_modifier = md if not playlist_advisor: logger.critical_error("Playlist advisor was not found")