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:
+11
-2
@@ -133,8 +133,17 @@ pub async fn ensure_face_track_node(
|
|||||||
.fetch_optional(pool)
|
.fetch_optional(pool)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if existing.is_some() {
|
if let Some((node_id,)) = existing {
|
||||||
return Ok(0);
|
// 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!(
|
let sql = format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user