Fix date parsing error in GS. (#8415)

This commit is contained in:
Alessandro Jean 2021-08-06 07:09:38 -03:00 committed by GitHub
parent 714c773714
commit 12a03e685b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,10 @@ package eu.kanade.tachiyomi.extension.pt.geassscanlator
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.OkHttpClient
import okhttp3.Response
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
@ -20,6 +23,13 @@ class GeassScanlator : WPMangaStream(
override val altName: String = "Nome alternativo: "
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
return document.select(chapterListSelector())
.map { chapterFromElement(it) }
}
// [...document.querySelectorAll('ul.genrez li')]
// .map(x => `Genre("${x.querySelector("label").innerHTML}", "${x.querySelector("input").value}")`)
// .join(',\n')

View File

@ -227,7 +227,7 @@ abstract class WPMangaStream(
}
fun parseChapterDate(date: String): Long {
return if (date.contains("ago")) {
return if (date.endsWith("ago")) {
val value = date.split(' ')[0].toInt()
when {
"min" in date -> Calendar.getInstance().apply {

View File

@ -46,7 +46,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
SingleLang("Sekte Doujin", "https://sektedoujin.xyz", "id", isNsfw = true, overrideVersionCode = 2),
SingleLang("Lemon Juice Scan", "https://lemonjuicescan.com", "pt-BR", isNsfw = true, overrideVersionCode = 1),
SingleLang("Phoenix Fansub", "https://phoenixfansub.com", "es"),
SingleLang("Geass Scanlator", "https://geassscan.xyz", "pt-BR", overrideVersionCode = 1)
SingleLang("Geass Scanlator", "https://geassscan.xyz", "pt-BR", overrideVersionCode = 2)
)
companion object {