diff --git a/app/main.py b/app/main.py index b698938..3d6eca1 100644 --- a/app/main.py +++ b/app/main.py @@ -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 diff --git a/app/templates/_jobs_table.html b/app/templates/_jobs_table.html index 0039dd3..965b4e9 100644 --- a/app/templates/_jobs_table.html +++ b/app/templates/_jobs_table.html @@ -15,7 +15,7 @@ preview # AUV · GP - label + plongée durée frames hors-eau @@ -38,8 +38,8 @@ {% if j.has_thumbnail %}{% else %}{% endif %} #{{ j.id }} - {{ j.auv }} · {{ j.gp_label }} - {{ j.segment_label }} + {{ j.auv }} · {{ j.gp_label }}
{{ j.gopro_serial[-6:] }} + {% if '–' in j.segment_label %}↓{{ j.segment_label.split('–')[0] }} ↑{{ j.segment_label.split('–')[1] }}{% else %}{{ j.segment_label }}{% endif %} {{ j.video_duration_fmt }} {% if j.frame_count %}{{ j.frame_count }}{% else %}—{% endif %} {% if j.trimmed_total %}−{{ j.trimmed_total }}{% else %}—{% endif %} @@ -50,8 +50,15 @@ {{ j.progress }}% {% if j.step %}
{{ j.step }}
{% endif %} - {% elif j.status == 'done' and j.viser_url %} - viser ↗ + {% elif j.status == 'done' %} + {% if j.viser_url %} + viser ↗ + {% else %} + + {% endif %} + {% if j.glb_url %} + GLB ↓ + {% endif %} {% elif j.status == 'skipped' %} skipped {% elif j.status == 'error' %}