|
|
|
|
@ -13,9 +13,8 @@ import org.koitharu.kotatsu.parsers.model.Manga
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaChapter
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaSource
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.MangaState
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.formatSimple
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.mapToSet
|
|
|
|
|
import java.text.DecimalFormat
|
|
|
|
|
import java.text.DecimalFormatSymbols
|
|
|
|
|
import com.google.android.material.R as materialR
|
|
|
|
|
|
|
|
|
|
@JvmName("mangaIds")
|
|
|
|
|
@ -119,17 +118,10 @@ val Manga.appUrl: Uri
|
|
|
|
|
.appendQueryParameter("url", url)
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
private val chaptersNumberFormat = DecimalFormat("#.#").also { f ->
|
|
|
|
|
f.decimalFormatSymbols = DecimalFormatSymbols.getInstance().also {
|
|
|
|
|
it.decimalSeparator = '.'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun MangaChapter.formatNumber(): String? {
|
|
|
|
|
if (number <= 0f) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
return chaptersNumberFormat.format(number.toDouble())
|
|
|
|
|
fun MangaChapter.formatNumber(): String? = if (number > 0f) {
|
|
|
|
|
number.formatSimple()
|
|
|
|
|
} else {
|
|
|
|
|
null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun Manga.chaptersCount(): Int {
|
|
|
|
|
|