You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 13:52:00 +01:00
oh shit
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user