Detect motion events per camera #111

Merged
coding-agent-marvin8 merged 0 commits from refs/pull/111/head into main 2026-07-14 09:25:20 +00:00
coding-agent-marvin8 commented 2026-07-14 09:06:14 +00:00 (Migrated from codeberg.org)

Motion snapshots from all cameras were grouped into events as one chronologically-sorted stream, so motion on two cameras within 60 seconds merged into a single event attributed to the first camera. This adds group_events_per_camera() — partition by camera, group per camera, merge sorted by start time — and swaps both call sites in the web routes.

The day view now shows simultaneous events side by side with correct camera names, thumbnails, and links; the calendar counts every camera's events.

Closes #110

Motion snapshots from all cameras were grouped into events as one chronologically-sorted stream, so motion on two cameras within 60 seconds merged into a single event attributed to the first camera. This adds group_events_per_camera() — partition by camera, group per camera, merge sorted by start time — and swaps both call sites in the web routes. The day view now shows simultaneous events side by side with correct camera names, thumbnails, and links; the calendar counts every camera's events. Closes #110
coding-agent-marvin8 commented 2026-07-14 09:18:15 +00:00 (Migrated from codeberg.org)

src/cang/web/routes/clips.py

Source file modified with non-trivial logic change (replacing group_into_events with group_events_per_camera) but no corresponding test file appears in the diff.

🔴 Declining — the logic change lives entirely in group_events_per_camera in src/cang/events.py, which has 5 dedicated unit tests covering the core bug scenario, simultaneous events, single-camera parity, and chronological ordering. The two call-site changes in clips.py are mechanical one-word swaps with no new branching or routing logic, so endpoint-level integration tests would duplicate coverage rather than add it.

[`src/cang/web/routes/clips.py`](https://codeberg.org/MinimalNVR/cang/pulls/111#issuecomment-19192664) > Source file modified with non-trivial logic change (replacing group_into_events with group_events_per_camera) but no corresponding test file appears in the diff. 🔴 Declining — the logic change lives entirely in `group_events_per_camera` in `src/cang/events.py`, which has 5 dedicated unit tests covering the core bug scenario, simultaneous events, single-camera parity, and chronological ordering. The two call-site changes in `clips.py` are mechanical one-word swaps with no new branching or routing logic, so endpoint-level integration tests would duplicate coverage rather than add it.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/cang!111
No description provided.