19 Commits

Author SHA1 Message Date
Isaac Connor
7b9c1ee1d2 fix: derive event end time from Length when EndDateTime is missing
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>
2026-05-14 06:46:01 -04:00
Steve Gilvarry
58a0e68731 Add Tags to event search and return tag data with events 2026-01-05 21:43:27 +11:00
Isaac Connor
46b27d9f78 Add Tags support to API 2023-11-03 13:33:28 -04:00
Isaac Connor
c811f1bc90 Load event using find_one which does caching. 2023-06-09 10:52:39 -04:00
Isaac Connor
0d561bbf73 Add StartTimeSecs and EndTimeSecs to returned data in Event 2023-05-12 14:10:53 -04:00
Isaac Connor
402b559b2c Add StartTime and EndTime virtual fields for backwards compatability 2020-11-06 11:15:12 -05:00
Isaac Connor
10c0a6617c Return Debug to a regular function to match other logging functions. Since we switched to using namespaces we no longer clash with cake_php. 2020-10-14 10:39:25 -04:00
Isaac Connor
4817efe17c Add enum support for Orientation and Scheme to Events 2019-11-29 13:48:20 -05:00
Isaac Connor
fa9803d819 Can't use this->data to avoid another db hit. Must load by id 2019-04-01 10:11:56 -04:00
Isaac Connor
a634d8b774 use id instead of this->data when loading Event to delete in API 2019-03-19 17:26:20 -04:00
Isaac Connor
df3e11d83c Fix authentication in api because we no longer store the user object in the session 2019-02-26 17:01:45 -05:00
Isaac Connor
92dc7878de Fix 2340 (#2368)
* include includes/functions.php so that we have access to all it's contents

* add a beforeDelete function which deletes the files.  Add other needed functions like Path() LinkPath() etc.

* add require_once for Storage and functions because we use them in Event

* Now that ZM has namespaces use the ZM Event class to do the heavy lifting of delete

* Don't need functions in AppController anymore
2019-02-26 11:28:56 -05:00
Isaac Connor
b3bed9a28a fix whitespace 2018-12-11 10:20:02 -05:00
Isaac Connor
62edca6dcb add fileSize to the api, and use it to add remote fileSize reporting in includes/Event 2018-05-08 13:33:56 -07:00
Isaac Connor
9c44f56f37 Add Storage to belongsTo. Implement Relative_Path and fileExists functions 2018-05-07 14:06:48 -07:00
Isaac Connor
85b7baa131 Fix event Groups associations 2017-12-19 18:09:41 -05:00
Isaac Connor
6270408c8f rework group MonitorIds and add GroupId filters to api 2017-12-04 15:52:16 -05:00
Kyle Johnson
9c7a15daf7 use deleteAll() vs. delete() when deleting an Event's Frames 2015-09-30 13:53:23 -06:00
Kyle Johnson
f1f3de6d7d Moved the api to underneath the web directory 2014-04-29 20:41:04 +00:00