Show download size when model length is unavailable
Build and publish frontend / publish (push) Successful in 49s

This commit is contained in:
Ein Anderssono
2026-10-16 07:55:18 +02:00
parent 291fdcbf08
commit 0bee9f40d3
4 changed files with 24 additions and 7 deletions
+7 -1
View File
@@ -170,7 +170,8 @@
const value = document.querySelector('#speech-progress-value');
const preparing = message.startsWith('Förbereder svensk uppläsning.');
const match = message.match(/^Hämtar svensk röstmodell till enheten: (\d+) procent\.$/);
if (!preparing && !match) {
const bytesMatch = message.match(/^Hämtar svensk röstmodell till enheten: ([\d.,]+) MB hämtade\.$/);
if (!preparing && !match && !bytesMatch) {
container.hidden = true;
progress.removeAttribute('value');
value.textContent = 'Väntar på nedladdning';
@@ -183,6 +184,11 @@
value.textContent = `${percent}%`;
return true;
}
if (bytesMatch) {
progress.removeAttribute('value');
value.textContent = `${bytesMatch[1]} MB hämtade`;
return true;
}
progress.removeAttribute('value');
value.textContent = 'Förbereder…';
return true;