Fix chapter refresh failing in locales with non-ASCII digits
Closes #4075
This commit is contained in:
@@ -35,6 +35,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
|||||||
### Removed
|
### Removed
|
||||||
- Remove "Custom hardware bitmap threshold" and "Custom display profile" advanced settings ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3786](https://github.com/mihonapp/mihon/pull/3786))
|
- Remove "Custom hardware bitmap threshold" and "Custom display profile" advanced settings ([@wwww-wwww](https://github.com/wwww-wwww)) ([#3786](https://github.com/mihonapp/mihon/pull/3786))
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed refreshing chapters failing with the app language set to Arabic or another language with its own digits ([@AntsyLich](https://github.com/AntsyLich))
|
||||||
|
|
||||||
## [v0.21.0] - 2026-10-12
|
## [v0.21.0] - 2026-10-12
|
||||||
### Added
|
### Added
|
||||||
- Add `id:` prefix search to remaining trackers (AniList, Bangumi, Kitsu, MangaUpdates, Shikimori, and Hikka) ([@MajorTanya](https://github.com/MajorTanya), [@BrutuZ](https://github.com/BrutuZ)) ([#3776](https://github.com/mihonapp/mihon/pull/3776))
|
- Add `id:` prefix search to remaining trackers (AniList, Bangumi, Kitsu, MangaUpdates, Shikimori, and Hikka) ([@MajorTanya](https://github.com/MajorTanya), [@BrutuZ](https://github.com/BrutuZ)) ([#3776](https://github.com/mihonapp/mihon/pull/3776))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package tachiyomi.domain.chapter.service
|
|||||||
import tachiyomi.domain.chapter.model.Chapter
|
import tachiyomi.domain.chapter.model.Chapter
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import java.text.DecimalFormatSymbols
|
import java.text.DecimalFormatSymbols
|
||||||
|
import java.util.Locale
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
import kotlin.math.round
|
import kotlin.math.round
|
||||||
|
|
||||||
@@ -77,9 +78,9 @@ object ChapterRecognition {
|
|||||||
private val prologue = Regex("""\b(?:prologue|one.?shot|pilot)\b""")
|
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.
|
* 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