Reduce size by Json Fromatting (#13163)

Reduce the size of current and new JSONs by standardising them with 1 tab indentation instead of 4 spaces.
This effectively reduces the size by almost 20 MB.

| Current | New |
|---|---|
| 85.2 Mib | 67 Mib |

Used [JQ](https://jqlang.org/) `--tab` to automatically format every current JSON.

> [!NOTE]
> Some profiles had the arrays on the same line, but those created by Orca were in the standard format (each object below the previous one). In some cases, this increases the number of tabs due to the new lines, but the increase is negligible, and this way both the base profiles and those created by Orca maintain the same style.
This commit is contained in:
Ian Bassi
2026-04-15 11:58:12 -03:00
committed by GitHub
parent f7ef8a14bd
commit 16727644bb
10101 changed files with 1871226 additions and 1860967 deletions

View File

@@ -131,7 +131,7 @@ def update_profile_library(vendor="",profile_type="filament"):
library = json.load(f)
library[profile_section] = sorted_profiles
f.seek(0)
json.dump(library, f, indent=4, ensure_ascii=False)
json.dump(library, f, indent="\t", ensure_ascii=False)
f.truncate()
print(f"Profile library for {vendor} updated successfully!")
@@ -229,7 +229,7 @@ def clean_up_profile(vendor="", profile_type="", force=False):
# write back to file
f.seek(0)
ordered_profile = create_ordered_profile(_profile, ['type', 'name', 'renamed_from', 'inherits', 'from', 'setting_id', 'filament_id', 'instantiation'])
json.dump(ordered_profile, f, indent=4, ensure_ascii=False)
json.dump(ordered_profile, f, indent="\t", ensure_ascii=False)
f.truncate()
print(f"Updated profile: {full_path}")
except Exception as e:
@@ -273,7 +273,7 @@ def rename_filament_system(vendor="OrcaFilamentLibrary"):
if modified:
with open(full_path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=4, ensure_ascii=False)
json.dump(data, f, indent="\t", ensure_ascii=False)
print(f"Updated {full_path}")
except Exception as e: