refactor: rimuove cache destinazione e forza rescansione completa

- elimina cache su disco in destination scanner
- rimuove integrazione cache da main process
- allinea messaggi progresso UI alla scansione completa
- aggiorna README con comportamento senza cache
This commit is contained in:
2026-03-16 16:27:55 +01:00
parent 65b1777a60
commit 9aec9d3a50
4 changed files with 5 additions and 181 deletions

View File

@@ -35,30 +35,21 @@ function hideProgress() {
let _indexFilesFound = 0;
function updateProgress({ phase, current, total, file, scanned, folder }) {
if (phase === 'index-cache') {
// folderIndex dalla cache — avvia scansione veloce dei file
progressBar.max = total || 1;
progressBar.value = 0;
progressLabel.textContent = 'Struttura dalla cache — ricerca file CAD in corso...';
return;
} else if (phase === 'scan') {
if (phase === 'scan') {
_indexFilesFound = 0;
progressLabel.textContent = 'Scansione file sorgente...';
progressBar.removeAttribute('value');
} else if (phase === 'index-dest') {
// scansione completa (nessuna cache)
progressBar.max = total;
progressBar.value = current;
const filesInfo = _indexFilesFound > 0 ? `${_indexFilesFound} file CAD trovati` : '';
progressLabel.textContent = `Analisi destinazione: ${current} / ${total}${folder ? `${folder}` : ''}${filesInfo}`;
} else if (phase === 'index-dup') {
if (current !== undefined && total !== undefined) {
// scansione veloce (cache attiva): current/total = cartelle processate
progressBar.max = total;
progressBar.value = current;
progressLabel.textContent = `Ricerca file CAD: ${current} / ${total} cartelle`;
progressLabel.textContent = `Analisi destinazione: ${current} / ${total} cartelle`;
} else {
// scansione completa: scanned = contatore file trovati
_indexFilesFound = scanned;
const dirInfo = progressBar.max > 0 ? `${progressBar.value} / ${progressBar.max}` : '';
progressLabel.textContent = `Analisi destinazione: ${dirInfo}${scanned} file CAD trovati`;