Snapshots page shows empty when source JPGs are deleted after transcode #90
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?
When a camera is configured with , the pipeline deletes all source snapshot files alongside the after transcoding completes. The route only searches , so it finds nothing and renders "No snapshots found" — even though a thumbnail copy survives in and is recorded in .
The static clip preview is served from the thumbnail copy just fine, so the "No snapshots found" message is clearly wrong whenever is set and the file exists.
Findings
The pipeline's delete path (pipeline.py _delete_source) removes both the .dav and every associated .jpg snapshot after transcoding when delete_after_transcode is enabled. The clip-snapshots route in src/cang/web/routes/snapshots.py only globs camera.root/day/channel/jpg and never consults clips.thumbnail. The thumbnail copy in output_dir is the only surviving snapshot but is never consulted.
Secondary: _snapshot_time in snapshots.py parses the second component with int(stem) while the Dahua adapter uses a leading-digits regex. If a filename has trailing non-digit characters the route silently drops the snapshot.
Plan of attack
Files changed: src/cang/web/routes/snapshots.py, tests/web/test_clip_snapshots.py, tests/test_snapshots.py