Bug fixing and ready for Extra Challenge

This commit is contained in:
UnitedAirforce
2025-08-16 11:17:02 +08:00
parent f96605063d
commit f05520b958
8 changed files with 122 additions and 23 deletions

View File

@@ -36,12 +36,12 @@ def get_4max_version_string():
def parse_res(res):
parsed_data = []
if isinstance(res, int):
if isinstance(res, int) or res == None:
return "Failed to fetch version info: Error " + str(res)
for item in res:
if item.get("isOpen"):
version = item.get("version", "Unknown Version")
version = item.get("version", 0)
changelog = "<br>".join(item.get("changeLog", {}).get("en", []))
parsed_data.append(f"<strong>Version: {version}</strong><p><strong>Changelog:</strong><br>{changelog}</p>")
return "".join(parsed_data)