diff --git a/public/index.html b/public/index.html index 186924d..57cdc3e 100644 --- a/public/index.html +++ b/public/index.html @@ -527,15 +527,23 @@ async function pollJob(jobId){ const avgPerCard = elapsedSec / done; aiEtaBaseSec = (total - done) * avgPerCard; aiEtaBaseTs = now; + } else if (done === 0 && total > 0) { + aiEtaBaseSec = total * 30; + aiEtaBaseTs = aiJobClientStartTs || now; } else { aiEtaBaseSec = null; aiEtaBaseTs = null; } } + if ((aiEtaBaseSec == null || aiEtaBaseTs == null) && done === 0 && total > 0) { + aiEtaBaseSec = total * 30; + aiEtaBaseTs = aiJobClientStartTs || now; + } + if (aiEtaBaseSec != null && aiEtaBaseTs != null && total > done) { const countdown = Math.max(0, aiEtaBaseSec - ((now - aiEtaBaseTs) / 1000)); - etaTxt = ` – Restdauer ~${fmtDuration(countdown)}`; + etaTxt = countdown < 10 ? ' – gleich fertig' : ` – Restdauer ~${fmtDuration(countdown)}`; } document.getElementById('aiProgressText').textContent = `${done}/${total} (${j.progress||0}%)${etaTxt}`;