Drop-video button (blocks reruns), manual title, striped recording groups, collapse whisper loops, fix report _clean name clash

This commit is contained in:
Stefano Zini
2026-11-03 15:06:00 +01:00
parent 0a66ae0c05
commit 68846600c1
3 changed files with 62 additions and 14 deletions
+4 -2
View File
@@ -17,14 +17,16 @@ def _log(msg):
def aggregate(segs):
"""(start,end,text) -> [(sec,text)]: flush on end punctuation, >1s gap, or >12s run."""
lines, buf, start, end = [], [], 0, 0
"""(start,end,text) -> [(sec,text)]: flush on end punctuation, >1s gap, or >12s run. A segment repeated 3+ times in a row is a whisper loop (46x "Ciao."): keep 2."""
lines, buf, start, end, last, rep = [], [], 0, 0, None, 0
def flush():
if buf:
lines.append((int(start), " ".join(buf))); buf.clear()
for s, e, t in segs:
t = t.strip()
if not t: continue
rep = rep + 1 if t == last else 0; last = t
if rep >= 2: continue
if buf and s - end > 1: flush()
if not buf: start = s
buf.append(t); end = e