feat: Default to Main Assembly V1 (2).stl model in repository and settings

This commit is contained in:
2026-08-26 00:42:04 +02:00
parent b98231ae08
commit c8f287cb3c
2 changed files with 9 additions and 0 deletions
Binary file not shown.
+9
View File
@@ -151,6 +151,15 @@ class ControlApi:
def _migrate_legacy_model(self):
if self.model_cache.is_file():
return
default_asset = Path(__file__).resolve().parent / "assets" / "Main Assembly V1 (2).stl"
if default_asset.is_file():
try:
self.model_cache.parent.mkdir(exist_ok=True)
shutil.copyfile(default_asset, self.model_cache)
self.model_cache_name.write_text(default_asset.name, encoding="utf-8")
return
except Exception:
pass
try:
path = Path(json.loads(self.model_path.read_text(encoding="utf-8"))["path"])
if path.is_file() and path.suffix.lower() == ".stl" and path.stat().st_size <= 30 * 1024 * 1024: