From b3a30c7ad7caa1ee4a5449279e0028fea3889564 Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 17 Nov 2026 09:12:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(settings):=20=E6=81=A2=E5=A4=8D=E8=A2=AB?= =?UTF-8?q?=E8=AF=AF=E5=88=A0=E7=9A=84=20backfillOutputOriginals=EF=BC=88?= =?UTF-8?q?=E7=82=B9=E8=AE=BE=E7=BD=AE=E6=8A=A5=20Can't=20find=20variable?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui-settings-modal.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ui-settings-modal.js b/src/ui-settings-modal.js index 7fe16d9..d2d4a46 100644 --- a/src/ui-settings-modal.js +++ b/src/ui-settings-modal.js @@ -394,6 +394,20 @@ function SettingsModal(props) { const transferSection = Sections ? Sections.renderTransferSection({ comp, hostFields, ih, it, setComp, setIH, setIt, }) : el('div', { className: 'iwb-hint' }, 'transferSection 未就绪(请刷新页面)') + // 补存缺失的原图:对已有缩略图但无原图的条目,重新抓取远程 url 写入 out_orig_ + // (之前这段随「图片保存」页一起被删掉了,导致设置页打开时 ReferenceError) + const backfillOutputOriginals = async () => { + try { + const r = await api('outputs').catch(() => null) + const files = (r && r.files) || [] + const targets = files.filter((f) => f && f.idb && !f.origIdb) + if (!targets.length) { setFolderMsg('没有需要补存的图片(原图都已备份)'); return } + let ok = 0 + for (const f of targets) { const key = await storeOutputThumb(f); if (key) ok++ } + setFolderMsg('补存完成:' + ok + ' / ' + targets.length + ' 张;重新打开图库查看原图') + try { props.onRefreshOutputs && props.onRefreshOutputs() } catch (e) { /* ignore */ } + } catch (e) { setFolderMsg('补存失败:' + String((e && e.message) || e)) } + } // 「图片与图库」:并入「通用」页;定时清理已去掉(桌面端不需要按天数自动删图) const imageLibSection = el('div', null, el('label', { className: 'iwb-check' },