From a4798533724fdbd14cb9036ad054c09c303a4082 Mon Sep 17 00:00:00 2001 From: pinokio Date: Tue, 3 Nov 2026 15:47:54 +0100 Subject: [PATCH] Add .gitignore, Update 3 files --- .gitignore | 8 ++++++++ README.md | 15 ++++++++++++++- app/flow.py | 8 ++++++-- app/server.py | 9 +++++---- 4 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe1e2c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +__pycache__/ +*.pyc +app/bin/ +app/models/ +app/out/ +app/env/ +env/ +logs/ diff --git a/README.md b/README.md index 1e70d29..4699a8b 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,17 @@ Click **Install**. It downloads ffmpeg, llama.cpp (CUDA 13), the diarization mod Alternative without the extension (desktop Teams, system loopback + mic): `cd app && uv run meet.py [--screen]`, Ctrl+C to stop. -Data lives in `app/out` (recordings, reports, `meetings.db`). **Reset** deletes models/binaries only, never `app/out`. +Data lives in `app/out`. **Reset** deletes models/binaries only, never `app/out`. One folder per meeting, one owner per datum: + +``` +out/meetings.db live state + search indexes (lines, shots, topics, call events, speaker map, memory) +out/_global/ llm.txt, step_stats.json, transcribe_device.txt, prefect/embed/llama logs +out//source. the only video/audio source (removed by "elimina video"; the CLI recorder writes source.wav + source.mp4) + audio.opus transcript.txt (raw whisper) diar_segments.json shots.json + shots/ glossary.json docs.json + report.json (+ .md .html .pdf renders) meta.json (manual title, upload filename) progress.json logs/ +``` + +The speaker-labelled transcript is the `lines` table (names are applied when the report renders); there is no `.spk.txt`. A meeting without `source.` cannot be re-run at all (`/run` returns 409, the GUI hides the run controls). Other CLI tools (from `app/`): @@ -59,6 +69,9 @@ Base URL `http://127.0.0.1:18765`. | POST | `/stop` | `name` → finalize recording, start pipeline | | POST | `/run` | `name`, `from`, `speakers` → accoda la pipeline (una alla volta; 409 se già in coda/esecuzione) | | POST | `/run_all` | `from` → rerun every recording one at a time, oldest first (API only) | +| POST | `/merge` | `names` = comma list of ≥2 `.webm` recordings of one call → `_merged` (stream copy, events time-shifted), queued | +| POST | `/title` | `name`, body = manual title (empty = clear) | +| POST | `/drop_video` | `name` → delete the source file of a finished meeting (report, transcript, shots stay; reruns then return 409) | | POST | `/speaker_map` | `name`, body = `{"Speaker 1": "Mario Rossi"}` → re-render | ### curl diff --git a/app/flow.py b/app/flow.py index c2c9c01..0224d13 100644 --- a/app/flow.py +++ b/app/flow.py @@ -89,12 +89,16 @@ def meeting(name: str, start_from: str = "audio", speakers: int = 0, model: str try: db.upsert_recording(name, flow_run_id=str(flow_run.id)) db.progress_start(name, start_from) + # shots (slow, one vision call per screen) depend only on the video: keep them when re-running an earlier step; an explicit "shots" run redoes them + sj = db.out_dir(name) / "shots.json" + skip_shots = start_from != "shots" and sj.exists() and sj.stat().st_size > 2 + if skip_shots and go("shots"): print("shots already done: skipped (run from 'shots' to redo)") if start_from == "render": memory.run(name, link=False) else: if go("audio"): t_audio(name) spk_chain = lambda: [t_diarize(name, speakers), t_speakers(name)] if go("diarize") else ([t_speakers(name)] if go("speakers") else None) - if device == "npu" and go("transcribe") and go("shots"): + if device == "npu" and go("transcribe") and go("shots") and not skip_shots: db.set_status(name, "transcribing") L.ensure() f_t = t_transcribe.submit(name, model, "npu", False) @@ -113,7 +117,7 @@ def meeting(name: str, start_from: str = "audio", speakers: int = 0, model: str else: if go("transcribe"): t_transcribe(name, model, device) spk_chain() - if go("shots"): L.ensure(); t_shots(name) + if go("shots") and not skip_shots: L.ensure(); t_shots(name) L.ensure(vision=False) # docs queries, report, memory are text-only: drop the vision encoder, use the text profile if go("docs"): t_docs(name) if go("report"): t_report(name) diff --git a/app/server.py b/app/server.py index 543f87f..6836034 100644 --- a/app/server.py +++ b/app/server.py @@ -438,13 +438,13 @@ sr.innerHTML=j.speech.map(r=>`
${E(r[0])} ${fmt(r[1])} ${E(r[2]||"")}: ${E(r async function run(n){const f=document.getElementById("f-"+n).value;const r=await fetch(`/run?name=${n}&from=${f}`,{method:"POST"});if(r.status==409)alert("già in esecuzione");tick()} async function mergeSel(){const n=[...document.querySelectorAll(".mg:checked")].map(x=>x.value);if(n.length<2)return alert("spunta almeno 2 registrazioni");const r=await fetch("/merge?names="+n.join(","),{method:"POST"});if(!r.ok)alert(await r.text());tick()} const open_=new Set(); -async function spk(n){open_.has(n)?open_.delete(n):open_.add(n);tick()} +async function spk(n){editing=false;open_.has(n)?open_.delete(n):open_.add(n);tick()} async function panel(n){const j=await (await fetch("/speakers?name="+n)).json(); return `${j.candidates.map(c=>``+ j.rows.map(r=>`
${E(r.label)} ${fmt(r.talk_s)} ${r.source}${r.source=="auto"&&r.overlap_s!=null?" "+Math.round(r.overlap_s)+"s":""}
${r.samples.map(E).join(" | ")}
`).join("")+ ``} async function saveSpk(n){const m={};document.querySelectorAll(`input[data-n="${n}"]`).forEach(i=>m[i.dataset.l]=i.value); -const r=await fetch("/speaker_map?name="+n,{method:"POST",body:JSON.stringify(m)});alert(await r.text())} +const r=await fetch("/speaker_map?name="+n,{method:"POST",body:JSON.stringify(m)});editing=false;alert(await r.text())} const sel={}; async function del_(n,label){if(!confirm(`Eliminare definitivamente "${label}"?\nVengono cancellati registrazione, trascrizione, schermate e report. Non si può annullare.`))return; const r=await fetch("/delete?name="+n,{method:"POST"});if(!r.ok)alert(await r.text());tick()} @@ -516,10 +516,11 @@ for(const r of j.recs){const st=r.running&&r.status=="done"?"running":r.status; const nm=r.title||r.upload; h+=`${nm?`${E(nm)}
${r.name}`:r.name} ${r.status}${r.receiving_age_s!=null&&r.status=="recording"?` ${r.receiving_age_s}s ago`:""}${r.error?`
${E(r.error)}`:""}${r.duration_s?fmt(r.duration_s):""}${r.speakers??""}${r.mb} ${r.files.includes("report.html")?`reportpdf`:""}${r.flow_run_id?`prefect`:""} -${r.mb?``:""}${r.mb?``:""}${r.mb&&r.status=="done"&&!r.running?``:""}${r.running?``:``}`; +${r.mb?``:""}${r.mb?``:""}${r.mb&&r.status=="done"&&!r.running?``:""}${r.running||r.status=="queued"?``:``}`; h+=progPanel(r); if(open_.has(r.name))h+=await panel(r.name);h+=""} -if(!document.activeElement||document.activeElement.tagName!="INPUT"){t.innerHTML=h;for(const k in sel){const e=document.getElementById(k);if(e)e.value=sel[k]}}}catch(e){}} +const ae=document.activeElement;if(!editing&&!(ae&&t.contains(ae)&&/^(INPUT|SELECT)$/.test(ae.tagName))){const ck=[...document.querySelectorAll(".mg:checked")].map(x=>x.value);t.innerHTML=h;for(const k in sel){const e=document.getElementById(k);if(e)e.value=sel[k]}document.querySelectorAll(".mg").forEach(x=>x.checked=ck.includes(x.value))}}catch(e){}} +let editing=false;t.addEventListener("input",e=>{if(e.target.dataset.n)editing=true}); tick();setInterval(tick,3000); """