Persist all clip snapshots to output_dir so they survive delete_after_transcode #92
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently _copy_thumbnail saves only the middle snapshot alongside the MP4. When delete_after_transcode = true, every other snapshot for the clip is permanently deleted, leaving the Snapshots page with at most one image regardless of how many the camera captured.
All snapshots within the clip's time window should be copied to output_dir before the source files are removed, so the Snapshots page remains fully usable under any configuration.
Findings: _copy_thumbnail in lifespan.py saves only clip.snapshots[len//2] — one file. _delete_source then removes every source JPG. The snapshots page has no way to recover them.
Plan of attack:
Files: src/cang/web/lifespan.py, src/cang/web/routes/snapshots.py, tests/web/test_lifespan.py, tests/web/test_clip_snapshots.py