Fix chapter refresh failing in locales with non-ASCII digits
Closes #4075
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user