Lowercased platform tags and uses name from id

This commit is contained in:
Lucas
2025-04-13 16:24:01 -07:00
parent e4a57dea4b
commit 0a10aae819
3 changed files with 633 additions and 615 deletions

View File

@@ -1,5 +1,22 @@
import json
# Load the JSON data from file
with open("source/data/applications.json", "r", encoding="utf-8") as file:
data = json.load(file)
# Convert all platform entries to lowercase
for app in data.get("applications", []):
if "platforms" in app and isinstance(app["platforms"], list):
app["platforms"] = [platform.lower() for platform in app["platforms"]]
# Write the modified data back to the file
with open("source/data/applications.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4)
print("All platform entries have been converted to lowercase.")
"""
# Load the JSON file
with open("source/data/applications.json", "r", encoding="utf-8") as file:
data = json.load(file)
@@ -13,3 +30,4 @@ with open("source/data/applications.json", "w", encoding="utf-8") as file:
json.dump(data, file, indent=4, ensure_ascii=False)
print("Operation successful: applications.json updated")
"""