feat: auto-generate UUID if manifest.json lacks id

This commit is contained in:
2026-07-27 09:45:34 +08:00
parent e3afb2ac9b
commit b8f07c0cba
+2 -1
View File
@@ -560,7 +560,8 @@ async def api_market_upload(file: UploadFile = File(...), name: str = "", catego
manifest = _json.loads(zf.read('manifest.json').decode('utf-8')) manifest = _json.loads(zf.read('manifest.json').decode('utf-8'))
if not manifest.get('id'): if not manifest.get('id'):
return {"error": "manifest.json 缺少 id"} import uuid
manifest['id'] = str(uuid.uuid4())
if not manifest.get('name'): if not manifest.get('name'):
return {"error": "manifest.json 缺少 name"} return {"error": "manifest.json 缺少 name"}