insight-chat: cargo fmt sweep on the get_faces_in_photo additions

Single-line dao lock + reordered faces import. No logic changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cameron Cordes
2026-05-07 17:53:31 -04:00
parent 6f0c15d0c5
commit 8bd1a85070
2 changed files with 7 additions and 13 deletions

View File

@@ -181,10 +181,7 @@ impl InsightGenerator {
dao.has_any_summaries(&cx).unwrap_or(false)
};
let faces_present = {
let mut dao = self
.face_dao
.lock()
.expect("Unable to lock FaceDao");
let mut dao = self.face_dao.lock().expect("Unable to lock FaceDao");
dao.has_any_faces(&cx).unwrap_or(false)
};
ToolGateOpts {
@@ -2217,16 +2214,13 @@ Return ONLY the summary, nothing else."#,
let mut out = format!("Found {} face(s) in this photo:\n", faces.len());
for f in &bound {
// Invariant: `bound` is filtered on `person_name.is_some()` above.
let name = f.person_name.as_deref().expect("bound face must have a name");
let name = f
.person_name
.as_deref()
.expect("bound face must have a name");
out.push_str(&format!(
"- {} (confidence {:.2}, bbox x={:.2} y={:.2} w={:.2} h={:.2}, source: {})\n",
name,
f.confidence,
f.bbox_x,
f.bbox_y,
f.bbox_w,
f.bbox_h,
f.source,
name, f.confidence, f.bbox_x, f.bbox_y, f.bbox_w, f.bbox_h, f.source,
));
}
for f in &unbound {

View File

@@ -1,6 +1,5 @@
use crate::ai::apollo_client::ApolloClient;
use crate::ai::face_client::FaceClient;
use crate::faces;
use crate::ai::insight_chat::{ChatLockMap, InsightChatService};
use crate::ai::openrouter::OpenRouterClient;
use crate::ai::{InsightGenerator, OllamaClient, SmsApiClient};
@@ -11,6 +10,7 @@ use crate::database::{
connect,
};
use crate::database::{PreviewDao, SqlitePreviewDao};
use crate::faces;
use crate::libraries::{self, Library, LibraryHealthMap};
use crate::tags::{SqliteTagDao, TagDao};
use crate::video::actors::{