Show thumbnails on past research cards

This commit is contained in:
pewdiepie-archdaemon
2026-06-30 05:17:46 +00:00
parent b8338b2399
commit a72ec0c116
8 changed files with 101 additions and 8 deletions
+22 -1
View File
@@ -99,13 +99,34 @@ async function _syncLibrary(options = {}) {
for (const item of (libData.research || [])) {
if (item.status !== 'done') continue;
if (dismissed.has(item.id)) continue;
if (_jobs.some(j => j.id === item.id)) continue;
const elapsed = item.duration ? _parseDuration(item.duration) : 0;
const existing = _jobs.find(j => j.id === item.id);
if (existing) {
let changed = false;
const updates = {
query: item.query || existing.query,
status: 'done',
elapsed: elapsed || existing.elapsed || 0,
sourceCount: item.source_count || existing.sourceCount || 0,
thumbnail: item.thumbnail || existing.thumbnail || '',
category: item.category || existing.category || '',
_fromLibrary: true,
};
for (const [key, value] of Object.entries(updates)) {
if (existing[key] !== value) {
existing[key] = value;
changed = true;
}
}
if (changed) _notify();
continue;
}
_jobs.push({
id: item.id, query: item.query, status: 'done',
progress: {}, startedAt: (item.started_at || 0) * 1000,
elapsed, result: null, sources: null, findings: null,
sourceCount: item.source_count || 0,
thumbnail: item.thumbnail || '',
category: item.category || '',
errorMsg: null, avgDuration: null, modelName: null,
settings: { max_rounds: item.rounds || 8 },