Allow reprocessing after video drop: skip audio/shots steps lacking media, limit reprocess dropdown to docs+; plus pending ext/report/ui changes
This commit is contained in:
+11
-6
@@ -185,14 +185,19 @@ def meeting(
|
||||
except (OSError, ValueError):
|
||||
previous_shots = []
|
||||
no_shots = (db.GLOBAL / "skip_shots.txt").exists() # GUI toggle "Salta schermate"
|
||||
skip_shots = no_shots
|
||||
# Toggle on with no prior shots: write empty placeholders so downstream steps find their files.
|
||||
if no_shots and not previous_shots:
|
||||
# Dropped video: reuse the shots already extracted; dropped source: reuse audio.opus (no audio/shots re-extraction).
|
||||
no_video = db.media(name)[1] is None
|
||||
skip_shots = no_shots or no_video
|
||||
# Toggle on (or no video) with no prior shots: write empty placeholders so downstream steps find their files.
|
||||
if skip_shots and not previous_shots:
|
||||
for file_name in ("shots.json", "glossary.json"):
|
||||
(db.out_dir(name) / file_name).write_text("[]")
|
||||
db.replace_shots(name, [])
|
||||
if skip_shots and should_run("shots"):
|
||||
print("shots skipped")
|
||||
|
||||
def audio_ok():
|
||||
return (db.out_dir(name) / "audio.opus").exists()
|
||||
# Title/render restart: re-run only text-only post-processing, no vision model needed.
|
||||
if start_from == "title":
|
||||
llama_server.ensure(vision=False)
|
||||
@@ -201,14 +206,14 @@ def meeting(
|
||||
elif start_from == "render":
|
||||
memory.run(name, link=False)
|
||||
else:
|
||||
if should_run("audio"):
|
||||
if should_run("audio") and db.media(name)[0]:
|
||||
audio_task(name)
|
||||
|
||||
# Speaker labelling: diarize, then name mapping.
|
||||
def speaker_chain():
|
||||
return (
|
||||
[diarize_task(name, speakers), speakers_task(name)]
|
||||
if should_run("diarize")
|
||||
if should_run("diarize") and audio_ok()
|
||||
else ([speakers_task(name)] if should_run("speakers") else None)
|
||||
)
|
||||
|
||||
@@ -245,7 +250,7 @@ def meeting(
|
||||
shots_future.result()
|
||||
else:
|
||||
# Sequential path (CUDA, or NPU without shots).
|
||||
if should_run("transcribe"):
|
||||
if should_run("transcribe") and audio_ok():
|
||||
transcribe_task(name, model, device)
|
||||
speaker_chain()
|
||||
if should_run("shots") and not skip_shots:
|
||||
|
||||
Reference in New Issue
Block a user