HentaiNexus: Add SChapter::date_upload (#10743)
* HentaiNexus: Add SChapter::date_upload Add SChapter::date_upload * Update build.gradle * Update HentaiNexus.kt to address comments * Update HentaiNexus.kt #2 Update to deal with Published row not available
This commit is contained in:
parent
ac069dd2ec
commit
93ba18cd9c
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = "HentaiNexus"
|
||||
extClass = ".HentaiNexus"
|
||||
extVersionCode = 11
|
||||
extVersionCode = 12
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -11,16 +11,21 @@ import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import keiyoushi.utils.tryParse
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import rx.Observable
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class HentaiNexus : ParsedHttpSource() {
|
||||
|
||||
@ -126,16 +131,22 @@ class HentaiNexus : ParsedHttpSource() {
|
||||
thumbnail_url = document.selectFirst("figure.image img")?.attr("src")
|
||||
}
|
||||
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
val id = manga.url.split("/").last()
|
||||
private val dateFormat by lazy {
|
||||
SimpleDateFormat("dd MMMM yyyy", Locale.US)
|
||||
}
|
||||
|
||||
return Observable.just(
|
||||
listOf(
|
||||
SChapter.create().apply {
|
||||
url = "/read/$id"
|
||||
name = "Chapter"
|
||||
},
|
||||
),
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
val document = response.asJsoup()
|
||||
val table = document.selectFirst(".view-page-details")!!
|
||||
val date_upload_str = table.selectFirst("td.viewcolumn:contains(Published) + td")?.text()
|
||||
|
||||
val id = response.request.url.toString().split("/").last()
|
||||
return listOf(
|
||||
SChapter.create().apply {
|
||||
url = "/read/$id"
|
||||
name = "Chapter"
|
||||
date_upload = dateFormat.tryParse(date_upload_str)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user