Spaces:
Running
Running
Commit History
-
Consolidate zip assets under static/
ClaudePreviously the zip put images in static/ but audio in a separate audio/ folder. Now everything lives in one static/ directory: scene_*.jpg frames and segment_*.mp3 clips share the namespace (different filename prefixes prevent collisions) and the bundle has a clean two-entry layout: study-guide.html static/ scene_0000.jpg scene_0001.jpg segment_0000.mp3 segment_0001.mp3 Changes: - bundle_zip writes audio_paths under static_dir_name (was audio_dir_name). - guide.html template emits {{image_dir}}/<filename> for both image and audio src, so a renamed image_dir flows through to audio too. - Orchestrator slices audio into inputs.frames_dir directly instead of a sibling audio/ dir, so freshly-built export-metadata bundles have audio in the same place metadata_to_segment expects. - main.py's worker reads audio bytes from result.audio_paths directly, no longer guessing the on-disk layout. - metadata_to_segment looks in frames_…f2b292d -
Fix CLI audio output: inline for single, bundle for zip, schema round-trip
Clauderun_pipeline already slices per-segment audio and sets seg.audio_filename, and guide.html emits src="audio/..." when that field is present. But the CLI's build command never inlined audio for --format single nor passed result.audio_paths to bundle_zip() for --format zip — so: - 'vgm build --format single' produced HTML referencing audio/segment_0001.mp3 paths that didn't exist next to it, breaking the 'self-contained HTML' contract. - 'vgm build --format zip' produced a zip with the HTML but no audio/ folder, so the audio references 404'd on extraction. - 'vgm render-from-metadata' had no audio_filename in the metadata schema at all; round-tripping a previously-built guide silently lost the audio entirely. Fixes: - SegmentMetadata gains audio_filename + migration default. The save/load round-trip now preserves it (test guard). - metadata_to_segment loads audio from <frames_dir.parent>/audio/<fn> when inline_images=True (so render-from-metadata -…c4e5c07 -
Phase D: --min-gap, --max-frames, --skip-ocr flag parity
Claudedetect_and_extract now applies, after dedup: an optional min_gap_seconds filter (drops frames closer than N seconds to the previous kept one) and an optional max_frames cap (uniform-stride downsample preserving first + last). Both unlink the dropped frame files so the output folder stays clean. run_pipeline gains skip_ocr (sets ocr_text to "" on every segment) and the new scene-tuning fields. These are exposed as CLI flags (--min-gap, --max-frames, --skip-ocr) on both `vgm build` and `vgm export-metadata`, and as form fields on POST /process so the web UI can use them too. Verified: 37 pytest tests pass (4 new — min-gap drops close frames, max-frames downsamples uniformly preserving first+last, max-frames is a no-op under the limit, CLI build with --skip-ocr --max-frames 2 emits at most 2 segments with empty ocr_text). https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4Lfe75e0e -
Phase A: unified metadata schema + vgm CLI
ClaudeAdd a pydantic-backed PageMetadata schema (app/pipeline/metadata.py) with KeyTerm and MathEquation models, plus dump/load/migrate helpers. Existing browser-editor `.edits.json` is upgraded to schema v2 by migrate_v1_to_v2 — old saves still load. Extract the FastAPI handler body into a shared run_pipeline helper in app/pipeline/orchestrator.py so the same orchestration is reused by the new vgm CLI (typer-based). Subcommands: build, export-metadata, render-from-metadata; the last one re-renders HTML from the JSON exported by either the editor or the CLI. Segment now carries optional key_terms / math_equations / include fields and a new render_from_metadata function turns a PageMetadata back into renderable Segments. render_guide / render_review accept subtitle, module, mathjax, and mathjax_src so subsequent phases (math equations, key terms) just need template + UI work. Verified: all 30 pytest tests pass, including a round-trip test that runs the full pipeline on smaller.m4v + M14_L3…2636772