diff --git a/lib-multisrc/slimereadtheme/build.gradle.kts b/lib-multisrc/slimereadtheme/build.gradle.kts index dc076cc37..9dce2478c 100644 --- a/lib-multisrc/slimereadtheme/build.gradle.kts +++ b/lib-multisrc/slimereadtheme/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 1 +baseVersionCode = 2 diff --git a/lib-multisrc/slimereadtheme/src/eu/kanade/tachiyomi/multisrc/slimereadtheme/SlimeReadTheme.kt b/lib-multisrc/slimereadtheme/src/eu/kanade/tachiyomi/multisrc/slimereadtheme/SlimeReadTheme.kt index d649a586c..a42c56e98 100644 --- a/lib-multisrc/slimereadtheme/src/eu/kanade/tachiyomi/multisrc/slimereadtheme/SlimeReadTheme.kt +++ b/lib-multisrc/slimereadtheme/src/eu/kanade/tachiyomi/multisrc/slimereadtheme/SlimeReadTheme.kt @@ -25,6 +25,8 @@ import okhttp3.Request import okhttp3.Response import rx.Observable import uy.kohesive.injekt.injectLazy +import java.text.SimpleDateFormat +import java.util.Locale import kotlin.math.min abstract class SlimeReadTheme( @@ -186,6 +188,7 @@ abstract class SlimeReadTheme( return items.map { SChapter.create().apply { name = "Cap " + parseChapterNumber(it.number) + date_upload = parseChapterDate(it.updated_at) chapter_number = it.number scanlator = it.scan?.scan_name url = "/book_cap_units?manga_id=$mangaId&cap=${it.number}" @@ -201,6 +204,10 @@ abstract class SlimeReadTheme( .replace(",", ".") } + private fun parseChapterDate(date: String): Long { + return try { dateFormat.parse(date)!!.time } catch (_: Exception) { 0L } + } + override fun getChapterUrl(chapter: SChapter): String { val url = "$baseUrl${chapter.url}".toHttpUrl() val id = url.queryParameter("manga_id")!! @@ -242,5 +249,6 @@ abstract class SlimeReadTheme( companion object { const val PREFIX_SEARCH = "id:" val FUNCTION_REGEX = """(?