From cd9589029610fe0f31a8f162c34f975b7ab0e3c4 Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Wed, 16 Sep 2026 12:44:13 +1000 Subject: [PATCH] Offer "Get files" for any import that lost its files Models imported before 'partial' existed are stored as 'imported' with an error, so they'd never show the button. Mark them on startup, and key the button on the stored error rather than the status. Co-Authored-By: Claude Opus 5 --- lib/collectionWatch.js | 3 +++ public/app.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/collectionWatch.js b/lib/collectionWatch.js index b5eea6e..6e8f9e0 100644 --- a/lib/collectionWatch.js +++ b/lib/collectionWatch.js @@ -30,6 +30,9 @@ function start() { // A check that was running when the server stopped isn't running now. db.query(`UPDATE watched_collections SET last_status = NULL WHERE last_status = 'checking'`) .catch((err) => console.warn('Could not clear stale watch checks:', err.message)); + // Imports recorded before 'partial' existed: a model with an error kept none of its files. + db.query(`UPDATE watched_collection_items SET status = 'partial' WHERE status = 'imported' AND error IS NOT NULL`) + .catch((err) => console.warn('Could not mark file-less imports:', err.message)); clearInterval(timer); timer = setInterval(() => { runDue().catch((err) => console.error('Collection watch failed:', err.message)); }, TICK_MS); if (timer.unref) timer.unref(); diff --git a/public/app.js b/public/app.js index e54da15..9630630 100644 --- a/public/app.js +++ b/public/app.js @@ -2200,7 +2200,7 @@ function watchHtml(w) { ${recent.length ? `
${recent.map((i) => ` ${i.model_id ? `` - : escapeHtml(i.title || i.design_id)}${i.error ? ` ${escapeHtml(i.error)}` : ''}${i.status === 'partial' && i.model_id + : escapeHtml(i.title || i.design_id)}${i.error ? ` ${escapeHtml(i.error)}` : ''}${i.error && i.model_id ? ` ` : ''}`).join('')}
` : ''} `; }