Spaces:
Running
Running
Commit History
-
Keep review HTML re-fetchable and serialize audio_filename in readState
Claude/result/{id} freed job.result.body after the first GET, but the upload page loads review HTML into an iframe and lets the user "Open in new tab" on the same URL — the second fetch hit 410. Skip the free for review-mode results (no attachment filename) so the body stays available for the job's TTL; single/zip downloads remain one-shot. readState() in review.html serialized image_filename but not audio_filename, so the per-segment audio element's data-audio-filename never made it into the state posted to /jobs/{id}/zip. The ZIP endpoint then rendered metadata with empty audio_filename fields and silently dropped all narration audio from the bundle even though the job still held the bytes. Pull data-audio-filename off the audio element and emit it in the segment object.e845d2d -
Validate segment filenames in /jobs/{id}/zip to block path traversal
ClaudeThe endpoint trusted state.segments[*].image_filename and audio_filename when joining them to frames_dir, so a crafted name like ../../etc/hosts would resolve outside the temp dir and bundle_zip would write that file into the archive as static/<basename>. Filenames now must match the same regex patterns the pipeline produces (primary, alt, or audio) or they are dropped, keeping resolved paths under frames_dir.a037749
-
Sync deps, format validation, /jobs workdir cleanup, timing tests
Claude1. pyproject.toml gains 'anthropic>=0.49' so 'pip install .' brings in the same dependency that requirements.txt declares. Previously fresh installs through package metadata silently lost the LLM feature even when the API key was set. 2. /jobs now wraps the file-save + form-parse phase in try/except so if anything fails between mkdtemp and worker handoff (disk full, bad max_frames value, copyfileobj raising), the workdir is shutil.rmtree'd before the 400 propagates. Mirrors the existing try/finally pattern in /process. Test guard added. 3. Both /jobs and /process now reject unknown 'format' values with a 400 instead of treating anything-not-review-or-single as zip. The CLI already validated this; the web layer now matches. Test guard added. 4. Five new test_scenes.py invariant tests pin the timing properties that align_segments depends on after frames are dropped: * indices contiguous from 0 * start_seconds strictly increasing * end >=…06c75aa -
Tolerate blank max_frames on /jobs and /process
ClaudeThe upload form left max_frames as a blank input by default, which posted "" and tripped FastAPI's int parser ("Input should be a valid integer, unable to parse string as an integer"). Two-pronged fix: - Front-end: strip empty optional fields (max_frames, min_gap, face_threshold, subtitle, module) from the FormData before posting to /jobs. - Server: accept max_frames as `str | None` and coerce in a small helper that treats blank/whitespace as None and surfaces a 400 for truly bad values. Regression covered: tests/test_progress.py asserts POST /jobs with max_frames="" returns 202. https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4Lc7cacd1 -
Live progress bar (web SSE + CLI rich) and rename images dir to 'static'
ClaudePipeline progress ----------------- orchestrator.run_pipeline now accepts an optional ProgressCallback and emits ProgressEvent(percent, stage, message) at each major phase: scene_detect, filter, transcript, ocr (per-frame), render, done. Errors emit a final 'error' event so consumers always see a terminal state. Web UI ------ New POST /jobs spawns the pipeline in a background thread, returns {job_id, events_url, result_url} (HTTP 202). GET /events/{job_id} streams Server-Sent Events with progress payloads. GET /result/{job_id} hands back the prepared HTML or zip. The upload page (templates/index.html) now intercepts the form submit, hides the form, shows a <progress> element with stage chip + message, subscribes via EventSource, and on 'done' either navigates to the review HTML (review mode) or kicks off a download (single/zip). The original synchronous /process endpoint is kept for non-browser clients. CLI --- `vgm build` and `vgm export-metadata` now display a rich progress bar (…4b79268