From 4bf81773a0aa17f4c7eb9985355089ea558d9d14 Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Fri, 13 Dec 2024 08:18:20 -0700 Subject: [PATCH] Fix index for cams. Closes #198 --- src/dbse.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dbse.cpp b/src/dbse.cpp index ed97a57..83baa4d 100644 --- a/src/dbse.cpp +++ b/src/dbse.cpp @@ -978,9 +978,11 @@ void cls_dbse::filelist_get(std::string sql, vec_files &p_flst) { int indx; if (dbse_open() == false) { + p_flst.clear(); return; } if (finish == true) { + p_flst.clear(); return; } @@ -1193,19 +1195,19 @@ void cls_dbse::dbse_edits() void cls_dbse::dbse_clean() { - int delcnt, indx; + int delcnt, indx, camindx; std::string sql, delimit; struct stat statbuf; vec_files flst; - for (indx=0;indxcam_cnt;indx++) { + for (camindx=0;camindxcam_cnt;camindx++) { if (check_exit() == true) { return; } sql = " select * from motionplus "; sql += " where device_id = "; - sql += std::to_string(app->cam_list[indx]->cfg->device_id); + sql += std::to_string(app->cam_list[camindx]->cfg->device_id); sql += " order by file_dtl, file_tml;"; filelist_get(sql, flst);