From 35012b68b510178bc633cc8d2a2dd06f7071056f Mon Sep 17 00:00:00 2001 From: brostosjoined Date: Wed, 4 Jun 2025 16:44:13 +0300 Subject: [PATCH] Support update of modder info --- test/auto_apply_plugin_metadata.py | 9 +++++++-- test/auto_apply_version_metadata.py | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/auto_apply_plugin_metadata.py b/test/auto_apply_plugin_metadata.py index ec1f43e..7c96352 100644 --- a/test/auto_apply_plugin_metadata.py +++ b/test/auto_apply_plugin_metadata.py @@ -11,12 +11,17 @@ def update_plugin_json(plugin_info, category): data = json.load(file) try: # Check if plugin is already in the json - data['plugins'][name] + plugin = data['plugins'][name] plugman_version = int(next(iter(data["plugins"][name]["versions"])).replace('.', '')) current_version = int(next(iter(details["versions"])).replace('.', '')) # `or` In case another change was made on the plugin while still on pr if current_version > plugman_version or current_version == plugman_version: - data[name][details]["versions"][next(iter(details["versions"]))] = None + plugin["versions"][next(iter(details["versions"]))] = None + # Ensure latest version appears first + plugin["versions"] = dict(sorted(plugin["versions"].items(), reverse=True)) + plugin["description"] = details["description"] + plugin["external_url"] = details["external_url"] + plugin["authors"] = details["authors"] elif current_version < plugman_version: raise Exception('Version cant be lower than the previous') except KeyError: diff --git a/test/auto_apply_version_metadata.py b/test/auto_apply_version_metadata.py index c424dd0..af486fa 100644 --- a/test/auto_apply_version_metadata.py +++ b/test/auto_apply_version_metadata.py @@ -221,7 +221,6 @@ def auto_apply_version_metadata(last_commit_sha): if __name__ == "__main__": try: last_commit_sha = sys.argv[1] - print(type(sys.argv), sys.argv) except KeyError: raise ValueError("Last commit SHA not provided.") else: