diff --git a/src/web/server.py b/src/web/server.py index da77ccb..e618514 100644 --- a/src/web/server.py +++ b/src/web/server.py @@ -818,7 +818,7 @@ class WebServer: # ── Block toggle (UI: PATCH /api/blocks {id, enabled}) ── @app.patch("/api/blocks") async def toggle_block(data: dict, channel: str = "guitar"): - """Enable/disable a block by its fx_type id.""" + """Enable/disable a block by its fx_type id — sets both enabled and bypass.""" from ..presets.types import Channel pm, pl, nam, ir = self._channel_deps(channel) if not pm: @@ -834,11 +834,12 @@ class WebServer: for b in preset.chain: if b.fx_type.value == block_id: b.enabled = bool(enabled) + b.bypass = not bool(enabled) # <-- added: sync bypass with enabled pm.save(preset, channel=Channel(channel)) # Reload pipeline if needed if pl: pl.load_preset(preset) - return {"ok": True, "id": block_id, "enabled": b.enabled} + return {"ok": True, "id": block_id, "enabled": b.enabled, "bypass": b.bypass} raise HTTPException(status_code=404, detail=f"Block '{block_id}' not found") except Exception as e: raise HTTPException(status_code=500, detail=str(e))