fix: prepend session GUID to filename when calling backend analyze

When files are stored in /mnt/converter/in/{guid}/, the backend
needs the full relative path. The analyze endpoint now constructs
'{guid}/{filename}' before passing to the backend API.
This commit is contained in:
Claus Lohmar 2026-07-23 09:46:28 +00:00
parent e53d05f7dc
commit bc20691390
2 changed files with 13 additions and 1 deletions

8
clean.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
/mnt/converter tree
rm -rf /mnt/converter/in/*
rm -rf /mnt/converter/out/*
rm -rf /mnt/converter/backend/__pycache__/
systemctl restart vm-bench-backend.service
systemctl status vm-bench-backend.service
tree /mnt/converter/

View file

@ -428,14 +428,18 @@ async def session_analyze(
vmid: int = Form(...),
filename: str = Form(...),
vm_name: str = Form(""),
session_id: str = Form(""),
):
"""Phase 2 — call the backend /analyze endpoint and render the result."""
err = _validate_vmid(vmid)
if err:
return render("_analysis.html", request=request, error=err)
# Prepend session subdirectory to the filename for the backend
backend_filename = f"{session_id}/{filename}" if session_id else filename
try:
analysis = api.analyze(vmid=vmid, filename=filename)
analysis = api.analyze(vmid=vmid, filename=backend_filename)
except ApiError as exc:
return render("_analysis.html", request=request,
error=f"Backend analysis failed: {exc.detail}")