| 1273 | const progressBar = document.getElementById('progress-bar'); |
| 1274 | const progressText = document.getElementById('progress-text'); |
| 1275 | if (progressBar) progressBar.style.width = `${percent}%`; |
| 1276 | if (progressText) progressText.textContent = `Checking files: ${lastScanProcessed}`; |
| 1277 | }); |
| 1278 | window.electron.onDbProgress((progress) => { |
| 1279 | if (window._scanThumbnailProgress) return; // Thumbnail phase drives progress so bar stays in sync with renders |
| 1280 | const percent = progress.total ? (progress.processed / progress.total) * 100 : 0; |
| 1281 | const renderProgressBar = document.getElementById('render-progress-bar'); |
| 1282 | const renderProgressText = document.getElementById('render-progress-text'); |
| 1283 | if (renderProgressBar) renderProgressBar.style.width = `${percent}%`; |
| 1284 | if (renderProgressText) renderProgressText.textContent = progress.processed + ' / ' + (progress.total || 0); |
| 1285 | }); |
| 1286 | try { |
| 1287 | let skippedDueToSize = 0; |
| 1288 | for (const stlHomeDir of stlHomes) { |
| 1289 | const scanInfo = await scanAndRenderDirectory(stlHomeDir, false, true, { suppressSizeNotice: true }); |
| 1290 | skippedDueToSize += Number(scanInfo && scanInfo.skippedDueToSize) || 0; |
| 1291 | } |
| 1292 | await maybeShowSkippedFileSizeNotice(skippedDueToSize); |