From 156dbca58746b68cb55f559becfcf5e430449db1 Mon Sep 17 00:00:00 2001 From: moonburnt Date: Sat, 11 Dec 2021 14:10:05 +0200 Subject: [PATCH] fix: negative spectator values - Added workaround for negative spectator values, thrown by api when server runs some out of date mod without dedicated spectator slots. - Since the issue above needs to be fixed asap, bumped version to 1.0.1 --- notashark/fetcher.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notashark/fetcher.py b/notashark/fetcher.py index afdf65f..2b267d8 100644 --- a/notashark/fetcher.py +++ b/notashark/fetcher.py @@ -207,7 +207,7 @@ def clean_server_info(self, info: dict) -> parts.KagServerInfo: game_mode += " (modded)" capacity = f"{len(info['playerList'])}/{info['maxPlayers']}" - if info["spectatorPlayers"]: + if info["spectatorPlayers"] > 0: #old mods may give negative values capacity += f" ({info['spectatorPlayers']} spectating)" link = f"" diff --git a/setup.py b/setup.py index 18b8606..077d9d6 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="notashark", - version="1.0.0", + version="1.0.1", description="notashark - discord bot for King Arthur's Gold", long_description=long_description, long_description_content_type="text/markdown",