diff --git a/.forgejo/scripts/update-wiki.py b/.forgejo/scripts/update-wiki.py index 418bb73..3fea163 100644 --- a/.forgejo/scripts/update-wiki.py +++ b/.forgejo/scripts/update-wiki.py @@ -26,6 +26,7 @@ for mod in glob.glob("pack/mods/*.toml"): moddata["name"] = data["name"] moddata["url"] = "" moddata["side"] = data["side"] + license = dict() if "modrinth" in data["update"]: id = data["update"]["modrinth"]["mod-id"] @@ -34,12 +35,12 @@ for mod in glob.glob("pack/mods/*.toml"): moddata["site"] = "Modrinth" if id in cache: - print("Using cached value: " + data["name"]) data = cache[id] else: - print("Not in cache: " + id + " - " + data["name"]) data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"] - cache[id] = data + license["name"] = data["name"] + license["url"] = data["url"] + cache[id] = license elif "curseforge" in data["update"]: moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"]) moddata["site"] = "CurseForge"