From 6d7abb3780e48677c28b648fdc1e84dd9676d878 Mon Sep 17 00:00:00 2001 From: qwint Date: Thu, 2 Oct 2025 18:56:11 -0500 Subject: [PATCH] Webhost: Ignore Invalid Worlds in Webhost (#5433) * filter world types at top of webhost so worlds that aren't loadable in webhost are "uninstalled" * mark invalid worlds, show error if any, then filter to exclude them --- WebHost.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WebHost.py b/WebHost.py index fd8daeb3..db465be6 100644 --- a/WebHost.py +++ b/WebHost.py @@ -109,6 +109,13 @@ if __name__ == "__main__": logging.exception(e) logging.warning("Could not update LttP sprites.") app = get_app() + from worlds import AutoWorldRegister + # Update to only valid WebHost worlds + invalid_worlds = {name for name, world in AutoWorldRegister.world_types.items() + if not hasattr(world.web, "tutorials")} + if invalid_worlds: + logging.error(f"Following worlds not loaded as they are invalid for WebHost: {invalid_worlds}") + AutoWorldRegister.world_types = {k: v for k, v in AutoWorldRegister.world_types.items() if k not in invalid_worlds} create_options_files() copy_tutorials_files_to_static() if app.config["SELFLAUNCH"]: