fix(starlark): use manifest filename field for .star downloads

Tronbyte apps don't always name their .star file to match the directory.
For example, the "analogclock" app has "analog_clock.star" (with underscore).

The manifest.yaml contains a "filename" field with the correct name.

Changes:
- download_star_file() now accepts optional filename parameter
- Install endpoint passes metadata['filename'] to download_star_file()
- Falls back to {app_id}.star if filename not in manifest

Fixes: "Failed to download .star file for analogclock" error

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-02-18 21:41:50 -05:00
parent 885fdeed62
commit c584f227c1
2 changed files with 11 additions and 5 deletions

View File

@@ -7558,7 +7558,9 @@ def install_from_tronbyte_repository():
temp_path = tmp.name
try:
success, error = repo.download_star_file(data['app_id'], Path(temp_path))
# Pass filename from metadata (e.g., "analog_clock.star" for analogclock app)
filename = metadata.get('filename') if metadata else None
success, error = repo.download_star_file(data['app_id'], Path(temp_path), filename=filename)
if not success:
return jsonify({'status': 'error', 'message': f'Failed to download app: {error}'}), 500