diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 5e2bc78..6479881 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -171,8 +171,10 @@ async fn get_people(_page: usize, _per_page: usize) -> Result, S } } - eprintln!("[get_people] page {} got {} identities", page, identities.len()); - if identities.len() < 100 { break; } + eprintln!("[get_people] page {} got {} identities, total so far: {}", page, identities.len(), all_people.len()); + + // API max is 20 per page, keep fetching until we get fewer than 20 + if identities.len() < 20 { break; } page += 1; } @@ -297,6 +299,20 @@ async fn update_identity_name(uuid: String, name: String) -> Result<(), String> Ok(()) } +#[tauri::command(rename_all = "camelCase")] +async fn update_identity_status(uuid: String, status: String) -> Result<(), String> { + let client = reqwest::Client::new(); + let url = format!("{}/api/v1/identity/{}?api_key={}", CORE_API, uuid, API_KEY); + let resp = client.patch(&url) + .json(&serde_json::json!({"status": status})) + .send().await + .map_err(|e| format!("Request failed: {}", e))?; + if !resp.status().is_success() { + return Err(format!("Update failed: {}", resp.status())); + } + Ok(()) +} + #[tauri::command(rename_all = "camelCase")] async fn delete_identity(uuid: String) -> Result<(), String> { let client = reqwest::Client::new(); @@ -415,6 +431,7 @@ fn main() { get_video_stream, get_identity_profile, update_identity_name, + update_identity_status, delete_identity, search_identities, get_face_candidates, diff --git a/src/views/PeopleView.vue b/src/views/PeopleView.vue index 72ee18f..a0dd954 100644 --- a/src/views/PeopleView.vue +++ b/src/views/PeopleView.vue @@ -106,6 +106,7 @@
{{ ctxMenu.person?.starred ? '☆ Unstar' : '★ Star' }}
+
{{ ctxMenu.person?.ignored ? '↺ Unignore' : '⊘ Ignore' }}
✎ Rename
⇄ Merge
@@ -265,6 +266,10 @@ function ctxAction(action: string) { p.starred = !p.starred const idx = people.value.findIndex((x: any) => x.identity_uuid === p.identity_uuid) if (idx >= 0) people.value[idx].starred = p.starred + } else if (action === 'ignore') { + invoke('update_identity_status', { uuid: p.identity_uuid, status: 'skipped' }).then(() => { + people.value = people.value.filter((x: any) => x.identity_uuid !== p.identity_uuid) + }).catch(e => console.error('Ignore failed:', e)) } else if (action === 'rename') { selectPerson(p) setTimeout(() => startEditName(), 100)