From d325812104d3a8abacd36847815ef4612f86669e Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Mon, 30 Sep 2024 21:12:47 +0200 Subject: [PATCH] gug --- .forgejo/scripts/update-wiki.py | 31 ++++++++++++++++--------------- index.toml | 2 +- pack.toml | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.forgejo/scripts/update-wiki.py b/.forgejo/scripts/update-wiki.py index bf1726c..7d8d85b 100644 --- a/.forgejo/scripts/update-wiki.py +++ b/.forgejo/scripts/update-wiki.py @@ -24,24 +24,25 @@ for mod in glob.glob("pack/mods/*.toml"): moddata = dict() moddata["name"] = data["name"] moddata["url"] = "" - moddata["side"] = data["side"] or "both" + moddata["side"] = data["side"] license = dict() - if "modrinth" in data["update"]: - id = data["update"]["modrinth"]["mod-id"] - moddata["id"] = id - moddata["url"] = "https://modrinth.com/mod/" + id - moddata["site"] = "Modrinth" + if "update" in data: + if "modrinth" in data["update"]: + id = data["update"]["modrinth"]["mod-id"] + moddata["id"] = id + moddata["url"] = "https://modrinth.com/mod/" + id + moddata["site"] = "Modrinth" - if id in cache: - data = cache[id] - else: - data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"] - cache[id] = data - moddata["license"] = data - elif "curseforge" in data["update"]: - moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"]) - moddata["site"] = "CurseForge" + if id in cache: + data = cache[id] + else: + data = requests.get("https://api.modrinth.com/v2/project/" + id).json()["license"] + cache[id] = data + moddata["license"] = data + elif "curseforge" in data["update"]: + moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"]) + moddata["site"] = "CurseForge" count[moddata["side"]] += 1 mods[moddata["name"]] = moddata diff --git a/index.toml b/index.toml index f311c67..8a2e753 100644 --- a/index.toml +++ b/index.toml @@ -2,7 +2,7 @@ hash-format = "sha256" [[files]] file = ".forgejo/scripts/update-wiki.py" -hash = "d6eb4fde3e39f638f1b114a54d1ff67fc69aee974ad1d6d8cf4a809b3e250783" +hash = "d209298c411bce72d7795d8fcf89a4c92d5cbe485b6e347e75ef29b4b1e36310" [[files]] file = ".forgejo/workflows/update-wiki.yaml" diff --git a/pack.toml b/pack.toml index c062609..d13f54f 100644 --- a/pack.toml +++ b/pack.toml @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0" [index] file = "index.toml" hash-format = "sha256" -hash = "f36588fd13fbbe794b6effa9da6c98e1195a89b8ccc1bf03bd5c000b3ff178d9" +hash = "f08bad13520e5e71cf1e1e454dbf43738042ab8212857b0a019c6eaf655268a8" [versions] fabric = "0.16.5"