Fix chapter refresh failing in locales with non-ASCII digits

Closes #4075
This commit is contained in:
AntsyLich
2026-10-12 11:22:47 +06:00
parent 143a060ac9
commit 8457fb91e0
2 changed files with 6 additions and 2 deletions
@@ -3,6 +3,7 @@ package tachiyomi.domain.chapter.service
import tachiyomi.domain.chapter.model.Chapter
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.Locale
import kotlin.math.floor
import kotlin.math.round
@@ -77,9 +78,9 @@ object ChapterRecognition {
private val prologue = Regex("""\b(?:prologue|one.?shot|pilot)\b""")
/**
* Formats numbers without trailing zeros and with a dot whatever the locale, e.g. 10.5, 3, 24.005
* Formats numbers without trailing zeros, with ASCII digits and a dot whatever the locale, e.g. 10.5, 3, 24.005
*/
private val formatter = DecimalFormat("#.###", DecimalFormatSymbols().apply { decimalSeparator = '.' })
private val formatter = DecimalFormat("#.###", DecimalFormatSymbols(Locale.ROOT))
/**
* The volume and chapter number recognized for a chapter, e.g. "10.5" or "19a", `null` when there is none.