mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-30 01:15:33 -04:00
When zmc is killed or crashes without writing EndDateTime, three code paths invent a fake end of NOW(), so an event from hours ago appears to extend across the entire down-time. Montage review then paints a bar that makes it look like recorded video exists where it doesn't. Length is flushed to the DB every few seconds during recording, so even crashed events have an accurate last-known duration. Fall back to StartDateTime + Length when EndDateTime IS NULL, and only fall back to NOW() when Length is also 0 (event has no recorded data yet). - web/api/app/Model/Event.php: EndTimeSecs and EndTime virtual fields, which is what the montagereview JS actually reads via the API. - web/ajax/events.php: same fix in the AJAX events list SQL. - web/skins/classic/views/montagereview.php: \$eventsSql kept in sync even though it is no longer executed directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>