parent
4f8715d432
commit
0615bf338a
|
@ -2,4 +2,4 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 1
|
baseVersionCode = 2
|
||||||
|
|
|
@ -25,6 +25,8 @@ import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
abstract class SlimeReadTheme(
|
abstract class SlimeReadTheme(
|
||||||
|
@ -186,6 +188,7 @@ abstract class SlimeReadTheme(
|
||||||
return items.map {
|
return items.map {
|
||||||
SChapter.create().apply {
|
SChapter.create().apply {
|
||||||
name = "Cap " + parseChapterNumber(it.number)
|
name = "Cap " + parseChapterNumber(it.number)
|
||||||
|
date_upload = parseChapterDate(it.updated_at)
|
||||||
chapter_number = it.number
|
chapter_number = it.number
|
||||||
scanlator = it.scan?.scan_name
|
scanlator = it.scan?.scan_name
|
||||||
url = "/book_cap_units?manga_id=$mangaId&cap=${it.number}"
|
url = "/book_cap_units?manga_id=$mangaId&cap=${it.number}"
|
||||||
|
@ -201,6 +204,10 @@ abstract class SlimeReadTheme(
|
||||||
.replace(",", ".")
|
.replace(",", ".")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun parseChapterDate(date: String): Long {
|
||||||
|
return try { dateFormat.parse(date)!!.time } catch (_: Exception) { 0L }
|
||||||
|
}
|
||||||
|
|
||||||
override fun getChapterUrl(chapter: SChapter): String {
|
override fun getChapterUrl(chapter: SChapter): String {
|
||||||
val url = "$baseUrl${chapter.url}".toHttpUrl()
|
val url = "$baseUrl${chapter.url}".toHttpUrl()
|
||||||
val id = url.queryParameter("manga_id")!!
|
val id = url.queryParameter("manga_id")!!
|
||||||
|
@ -242,5 +249,6 @@ abstract class SlimeReadTheme(
|
||||||
companion object {
|
companion object {
|
||||||
const val PREFIX_SEARCH = "id:"
|
const val PREFIX_SEARCH = "id:"
|
||||||
val FUNCTION_REGEX = """(?<script>\[""\.concat\("[^,]+,"\."\)\.concat\((?<infix>[^,]+),":\d+"\)\])""".toRegex(RegexOption.DOT_MATCHES_ALL)
|
val FUNCTION_REGEX = """(?<script>\[""\.concat\("[^,]+,"\."\)\.concat\((?<infix>[^,]+),":\d+"\)\])""".toRegex(RegexOption.DOT_MATCHES_ALL)
|
||||||
|
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.ROOT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ data class MangaInfoDto(
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ChapterDto(
|
data class ChapterDto(
|
||||||
@SerialName("btc_cap") val number: Float,
|
@SerialName("btc_cap") val number: Float,
|
||||||
|
@SerialName("btc_date_updated") val updated_at: String,
|
||||||
val scan: ScanDto?,
|
val scan: ScanDto?,
|
||||||
) {
|
) {
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|
Loading…
Reference in New Issue