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' },