fix: Library thumbnail guard, Search People/Agent modes, People pagination debug

This commit is contained in:
2026-06-14 20:34:36 +08:00
parent b8bd7c05be
commit 07d9ebda29
3 changed files with 26 additions and 4 deletions

View File

@@ -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 })

View File

@@ -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)