tone3000: IR downloads, model detail, arch filter, metadata
- NAM/IR tab toggle in Downloads overlay - Architecture filter (All/Nano/Feather/Standard) - filters via Supabase architecture_version column - Model detail overlay: tap a search result to see full description, gear info, author, pack, architecture, thumbnail before downloading - IR search + install with .meta.json metadata saving - Backend: search_models/get_trending_models accept arch param - Backend: tone_gear field added to model search response
This commit is contained in:
+22
-3
@@ -1751,7 +1751,7 @@ class WebServer:
|
||||
return {"online": ok}
|
||||
|
||||
@app.get("/api/models/tonedownload/search")
|
||||
async def tonedownload_search_models(q: str = "", page: int = 0):
|
||||
async def tonedownload_search_models(q: str = "", page: int = 0, arch: str = ""):
|
||||
"""Search Tone3000 for NAM models."""
|
||||
try:
|
||||
client = await self._get_tonedownload()
|
||||
@@ -1764,10 +1764,11 @@ class WebServer:
|
||||
"message": "Tone3000 unavailable - using local defaults",
|
||||
},
|
||||
)
|
||||
arch_val = arch.strip() or None
|
||||
if not q.strip():
|
||||
results = await client.get_trending_models()
|
||||
results = await client.get_trending_models(arch=arch_val)
|
||||
else:
|
||||
results = await client.search_models(q.strip(), page=page)
|
||||
results = await client.search_models(q.strip(), page=page, arch=arch_val)
|
||||
return {
|
||||
"results": [
|
||||
{
|
||||
@@ -1781,6 +1782,7 @@ class WebServer:
|
||||
"thumbnail": r.thumbnail_url,
|
||||
"download_url": r.download_url,
|
||||
"tone_description": r.tone_description,
|
||||
"tone_gear": r.tone_gear,
|
||||
"pack_name": r.pack_name,
|
||||
"architecture": r.architecture,
|
||||
"created_at": r.created_at,
|
||||
@@ -1995,6 +1997,23 @@ class WebServer:
|
||||
path = await client.download_ir(ir)
|
||||
if not path:
|
||||
raise HTTPException(status_code=500, detail="Download failed")
|
||||
# Save IR metadata
|
||||
import json
|
||||
meta = {
|
||||
"id": data.get("id"),
|
||||
"name": data.get("name"),
|
||||
"filename": data.get("filename"),
|
||||
"size_bytes": data.get("size"),
|
||||
"author": data.get("author"),
|
||||
"author_avatar": data.get("author_avatar"),
|
||||
"thumbnail": data.get("thumbnail"),
|
||||
"tone_description": data.get("tone_description"),
|
||||
"created_at": data.get("created_at"),
|
||||
"download_date": datetime.datetime.now().isoformat(),
|
||||
"source": "tone3000",
|
||||
}
|
||||
meta_path = path.with_suffix(".meta.json")
|
||||
meta_path.write_text(json.dumps(meta, indent=2))
|
||||
ir_loader = self.deps.ir_loader
|
||||
if ir_loader:
|
||||
ir_loader.get_irs()
|
||||
|
||||
Reference in New Issue
Block a user