feat: dashboard — plongée label, serial visible, GLB link, is_file thumbnail fix
This commit is contained in:
@@ -196,7 +196,7 @@ def _build_acquisitions():
|
||||
d["video_duration_fmt"] = _fmt_dur(int(j["video_duration_s"] or 0)) if (j["video_duration_s"] or 0) > 0 else "—"
|
||||
d["trimmed_total"] = (j["trimmed_head"] or 0) + (j["trimmed_tail"] or 0)
|
||||
thumb_path = DB_PATH.parent / "thumbnails" / f"job_{j['id']}.jpg"
|
||||
d["has_thumbnail"] = thumb_path.exists()
|
||||
d["has_thumbnail"] = thumb_path.is_file()
|
||||
# Bust the browser cache on the mtime so the preview refreshes as the dispatcher re-copies it.
|
||||
d["thumb_ts"] = int(thumb_path.stat().st_mtime) if d["has_thumbnail"] else 0
|
||||
# Try the new column; fall back silently on old rows.
|
||||
@@ -207,6 +207,13 @@ def _build_acquisitions():
|
||||
# Mask the viser link when the demo.py that was serving it has since died.
|
||||
if j["status"] == "done" and j["viser_url"] and not _viser_alive(j["viser_url"]):
|
||||
d["viser_url"] = None
|
||||
# GLB download link: served by http.server 8300 on the worker
|
||||
glb_url = None
|
||||
if d.get("status") == "done" and d.get("frames_dir") and d.get("worker_host"):
|
||||
frames_basename = (d["frames_dir"] or "").rstrip("/").split("/")[-1]
|
||||
if frames_basename:
|
||||
glb_url = f"http://{d['worker_host']}:8300/{frames_basename}/reconstruction.glb"
|
||||
d["glb_url"] = glb_url
|
||||
by_acq.setdefault(j["acquisition_id"], []).append(d)
|
||||
by_acq_total[j["acquisition_id"]] = by_acq_total.get(j["acquisition_id"], 0) + dur_s
|
||||
|
||||
|
||||
Reference in New Issue
Block a user