fix: an oversized install step count falls back to the step text

This commit is contained in:
maxjivi05 committed 2026-10-23 22:51:28 -04:00
1 parent 7419ba114f
commit 5981bbb1e2
1 file changed
+3 -1
@@ -139,7 +139,9 @@ class LoadingState(context: Context, private val steam: Boolean = true) {
if (done != null && total != null && total > 0) {
return "$done / $total MB" to (done * 100 / total).toInt().coerceIn(0, 100)
}
return count.groupValues[1] to count.groupValues[2].toInt() * 100 / maxOf(1, count.groupValues[3].toInt())
val part = count.groupValues[2].toIntOrNull() ?: return null
val all = count.groupValues[3].toIntOrNull() ?: return null
return count.groupValues[1] to part * 100 / maxOf(1, all)
}
internal fun readableScriptStep(scriptStep: String): Boolean {