fix: update tkg_nodes.label when face_track node already exists

- ensure_face_track_node now UPDATEs label instead of returning early
- Fixes rename persistence - names are now stored in database
- Enables consistent names across all access points (localhost, DDNS)
This commit is contained in:
Accusys
2026-10-30 22:47:16 +08:00
parent b1bc83586f
commit 2fca49b120
+11 -2
View File
@@ -133,8 +133,17 @@ pub async fn ensure_face_track_node(
.fetch_optional(pool)
.await?;
if existing.is_some() {
return Ok(0);
if let Some((node_id,)) = existing {
// Node exists - update the label
let res = sqlx::query(&format!(
"UPDATE {tkg_table} SET label = $1, properties = $2 WHERE id = $3"
))
.bind(name)
.bind(&props)
.bind(node_id)
.execute(pool)
.await?;
return Ok(res.rows_affected());
}
let sql = format!(