The report engine now keeps a separate SQLite database for every local
hour inside the day folder:
data/reports/YYYY/MM/DD/report_HH.db (REPORT_DB_NAME_FMT "report_%02d.db")
Pictures and videos stay in the day folder; the stat.db day records are
unchanged.
- sqliteDBC::openHourReport(): opens/creates report_HH.db of the given day
and hour (replaces openDayReport); switchReportToCurrentHour() (renamed
from switchReportToCurrentDay) switches when the local day or hour
changes. connect() opens the current hour's file at startup.
- mojoKernel::handleReportPeriodChange() (was handleDayChange): runs the
same close-then-switch sequence every local hour: an open session that
started in the previous hour is closed in the old file (waiting at most
REPORT_SWITCH_MAX_VIDEO_WAIT for a recording with events), then the
report switches to the new hour; the next event opens a new session.
Each hourly file therefore contains complete sessions.
- getLocalHour() helper in basicFunctionality.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16