mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-15 12:58:04 +00:00
Show thumbnails on past research cards
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user