Interim commit before breaking things

This commit is contained in:
oitsjustjose 2026-08-29 21:52:28 -05:00
commit 168d9cece4
2 changed files with 5 additions and 5 deletions

View file

@ -36,11 +36,11 @@ async def list_servers(client: DockerClient, all: bool = False) -> list[dict]:
(List[Dict[str, any]]) A list of results from __extract_info
"""
def __container_filter(container: Container) -> bool:
image = container.attrs.get("Config", {}).get("Image", "")
return image == "itzg/minecraft-server" and "net.forgeserv.hidden" not in container.labels
def __filter(container: Container) -> bool:
image: str = container.attrs.get("Config", {}).get("Image", "")
return image.startswith("itzg/minecraft-server") and "net.forgeserv.hidden" not in container.labels
containers: list[Container] = list(filter(__container_filter, client.containers.list(all=all)))
containers: list[Container] = list(filter(__filter, client.containers.list(all=all)))
ret = await asyncio.gather(*(Server.from_container(c) for c in containers))
ret = await asyncio.gather(*(x.asdict() for x in ret))

View file

@ -246,7 +246,7 @@ class Server:
ret.icon = __get_from_exec("base64 -i server-icon.png")
# The rest we'll get from labels if we can
ret.display_name = __get_from_label(DerivedInfoLabelKeys.DISPLAY_NAME) or ret.motd
ret.display_name = __get_from_label(DerivedInfoLabelKeys.DISPLAY_NAME) or container.name or ""
ret.game_version = __get_from_label(DerivedInfoLabelKeys.GAME_VERSION) or Server.get_from_env(container, "VERSION")
ret.pack_version = __get_from_label(DerivedInfoLabelKeys.PACK_VERSION)
ret.dynmap = __get_from_label(DerivedInfoLabelKeys.DYNMAP)