From 87fafa43a826440db6e72389a93d08a0b91e15ca Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 9 Jul 2023 12:02:07 -0400 Subject: [PATCH] Add storing Latitude&Longitude in the event record. --- src/zm_event.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index f52445c75..075c3c971 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -116,9 +116,9 @@ Event::Event( std::string sql = stringtf( "INSERT INTO `Events` " - "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` )" + "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme`, `Latitude`, `Longitude` )" " VALUES " - "( %d, %d, 'New Event', from_unixtime(%" PRId64 "), %u, %u, '%s', '%s', %d, %d, %d, '%s', %d, '%s' )", + "( %d, %d, 'New Event', from_unixtime(%" PRId64 "), %u, %u, '%s', '%s', %d, %d, %d, '%s', %d, '%s', '%f', '%f' )", monitor->Id(), storage->Id(), static_cast(std::chrono::system_clock::to_time_t(start_time)), @@ -131,7 +131,9 @@ Event::Event( 0, video_incomplete_file.c_str(), save_jpegs, - storage->SchemeString().c_str() + storage->SchemeString().c_str(), + monitor->Latitude(), + monitor->Longitude() ); do { id = zmDbDoInsert(sql);