fix: Library thumbnail guard, Search People/Agent modes, People pagination debug
This commit is contained in:
@@ -153,7 +153,7 @@ async fn get_people(_page: usize, _per_page: usize) -> Result<Vec<PersonInfo>, S
|
||||
let mut page = 1;
|
||||
|
||||
loop {
|
||||
let url = format!("{}/api/v1/identities?api_key={}&page={}&per_page=50", CORE_API, API_KEY, page);
|
||||
let url = format!("{}/api/v1/identities?api_key={}&page={}&per_page=100", CORE_API, API_KEY, page);
|
||||
let response = client.get(&url).send().await.map_err(|e| format!("Request failed: {}", e))?;
|
||||
let json: serde_json::Value = response.json().await.map_err(|e| format!("Parse failed: {}", e))?;
|
||||
|
||||
@@ -171,7 +171,8 @@ async fn get_people(_page: usize, _per_page: usize) -> Result<Vec<PersonInfo>, S
|
||||
}
|
||||
}
|
||||
|
||||
if identities.len() < 50 { break; }
|
||||
eprintln!("[get_people] page {} got {} identities", page, identities.len());
|
||||
if identities.len() < 100 { break; }
|
||||
page += 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ function formatDate(date: string) {
|
||||
}
|
||||
|
||||
async function loadThumbnail(uuid: string) {
|
||||
if (thumbnails.value[uuid] || thumbnailLoading.value.has(uuid)) return
|
||||
if (!uuid || thumbnails.value[uuid] || thumbnailLoading.value.has(uuid)) return
|
||||
thumbnailLoading.value.add(uuid)
|
||||
try {
|
||||
thumbnails.value[uuid] = await invoke('get_thumbnail', { uuid, frame: 30 })
|
||||
|
||||
@@ -78,7 +78,28 @@ async function search() {
|
||||
loading.value = true
|
||||
searched.value = false
|
||||
try {
|
||||
results.value = await invoke('search_llm_smart', { query: query.value, limit: 20 })
|
||||
if (mode.value === 'people') {
|
||||
const result: any = await invoke('search_identities', { query: query.value, limit: 50 })
|
||||
results.value = (Array.isArray(result) ? result : []).map((p: any) => ({
|
||||
file_uuid: p.identity_uuid,
|
||||
file_name: p.name,
|
||||
summary: `Identity - ${p.source}`,
|
||||
similarity: 1.0,
|
||||
start_time: 0,
|
||||
end_time: 0
|
||||
}))
|
||||
} else if (mode.value === 'agent') {
|
||||
results.value = [{
|
||||
file_uuid: '',
|
||||
file_name: 'Agent Mode',
|
||||
summary: 'Agent mode is not yet implemented',
|
||||
similarity: 0,
|
||||
start_time: 0,
|
||||
end_time: 0
|
||||
}]
|
||||
} else {
|
||||
results.value = await invoke('search_llm_smart', { query: query.value, limit: 20 })
|
||||
}
|
||||
searched.value = true
|
||||
} catch (e) {
|
||||
console.error('Search failed:', e)
|
||||
|
||||
Reference in New Issue
Block a user