Avoiding to upload rendered file

This commit is contained in:
2026-07-15 11:43:22 +02:00
parent c30c0f1c5e
commit bb1b17d531
2 changed files with 53 additions and 16 deletions
+43 -7
View File
@@ -2920,7 +2920,11 @@ def cmd_trim(
seg_force = force or source_changed
existing = raw_data.get(seg_id, {})
has_explicit = "skip" in existing or "take" in existing
# Any manual trim point counts as "already trimmed" — including the
# user-friendly begin/end/start aliases. Without this, a segment with
# only a manual `begin` would be re-trimmed and have auto-detected
# skip/take written over it, silently clobbering the intended trim.
has_explicit = any(k in existing for k in ("skip", "take", "begin", "end", "start"))
if has_explicit and not seg_force:
print(f" {seg_id}: already trimmed, skipping (use --force to redo)")
_trim_fps[seg_id] = current_fp # adopt/keep current fingerprint
@@ -3466,15 +3470,47 @@ def cmd_stitch(
# Get segment IDs in natural order (Segment2 before Segment10)
segment_ids = sorted(narration.keys(), key=lambda s: [int(t) if t.isdigit() else t.lower() for t in re.split(r'(\d+)', s)])
# Show what we're stitching
# Show what we're stitching, and — importantly — where each segment's trim
# points came from: the user-friendly begin/end aliases, an explicit
# skip/take (e.g. written by 'trim'), or the project-level defaults. This
# makes the start/end determination visible instead of a bare number.
default_begin = config.default_begin if config else 0.0
default_end_trim = config.default_end_trim if config else 0.0
try:
_raw_narr = _read_json(_local_narration_json) if _local_narration_json.exists() else {}
except (OSError, json.JSONDecodeError):
_raw_narr = {}
print(f"\n Segments ({len(segment_ids)}):")
for segment_id in segment_ids:
seg = narration[segment_id]
skip_str = f"skip={seg.skip:.1f}s" if seg.skip else ""
take_str = f"take={seg.take:.1f}s" if seg.take else ""
trim_info = ", ".join(filter(None, [skip_str, take_str]))
trim_str = f" ({trim_info})" if trim_info else ""
print(f" - {segment_id}{trim_str}")
entry = _raw_narr.get(segment_id) or _raw_narr.get(segment_id.lower()) or {}
if entry.get("begin"):
skip_from = f"from begin={entry['begin']}"
elif entry.get("start"):
skip_from = f"from start={entry['start']}"
elif "skip" in entry:
skip_from = "explicit skip"
elif default_begin:
skip_from = f"from default_begin={default_begin:g}s"
else:
skip_from = None
if entry.get("end"):
take_from = f"from end={entry['end']}"
elif "take" in entry:
take_from = "explicit take"
elif seg.take is not None and default_end_trim:
take_from = f"from default_end_trim={default_end_trim:g}s"
else:
take_from = None
skip_disp = f"skip={seg.skip:.1f}s" + (f" ({skip_from})" if skip_from else "")
take_disp = f"take={seg.take:.1f}s" if seg.take is not None else "take=to end"
if take_from:
take_disp += f" ({take_from})"
print(f" - {segment_id}: {skip_disp} · {take_disp}")
stitch_output = videos_dir_out / "narration_combined.mov"