Add simply hentai ext chapter upload date (#5421)
* Set default status as completed * Parse manga date and set as chapter attribute * Bump simply-hentai version
This commit is contained in:
parent
eaa10925a9
commit
b3707d3b6f
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'Simply Hentai'
|
extName = 'Simply Hentai'
|
||||||
pkgNameSuffix = 'all.simplyhentai'
|
pkgNameSuffix = 'all.simplyhentai'
|
||||||
extClass = '.SimplyHentaiFactory'
|
extClass = '.SimplyHentaiFactory'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
containsNsfw = true
|
containsNsfw = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.all.simplyhentai
|
package eu.kanade.tachiyomi.extension.all.simplyhentai
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import com.github.salomonbrys.kotson.forEach
|
import com.github.salomonbrys.kotson.forEach
|
||||||
import com.github.salomonbrys.kotson.fromJson
|
import com.github.salomonbrys.kotson.fromJson
|
||||||
import com.github.salomonbrys.kotson.get
|
import com.github.salomonbrys.kotson.get
|
||||||
|
@ -13,12 +14,14 @@ import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
abstract class SimplyHentai(
|
abstract class SimplyHentai(
|
||||||
override val lang: String,
|
override val lang: String,
|
||||||
|
@ -119,6 +122,7 @@ abstract class SimplyHentai(
|
||||||
manga.description += info.select("div.link-box > div.box-title:contains(Characters) ~ a").let { e ->
|
manga.description += info.select("div.link-box > div.box-title:contains(Characters) ~ a").let { e ->
|
||||||
if (e.text().isNotEmpty()) ("Characters: ${e.joinToString { it.text() }}\n\n") else ""
|
if (e.text().isNotEmpty()) ("Characters: ${e.joinToString { it.text() }}\n\n") else ""
|
||||||
}
|
}
|
||||||
|
manga.status = SManga.COMPLETED
|
||||||
}
|
}
|
||||||
manga.thumbnail_url = document.select("div.col-xs-12 img.img-responsive").attr("abs:data-src")
|
manga.thumbnail_url = document.select("div.col-xs-12 img.img-responsive").attr("abs:data-src")
|
||||||
|
|
||||||
|
@ -128,11 +132,17 @@ abstract class SimplyHentai(
|
||||||
// Chapters
|
// Chapters
|
||||||
|
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
val chapter = SChapter.create().apply {
|
return listOf(
|
||||||
name = "Chapter"
|
SChapter.create().apply {
|
||||||
url = response.request().url().toString().removeSuffix("/").substringAfterLast("/")
|
name = "Chapter"
|
||||||
}
|
url = response.request().url().toString().removeSuffix("/").substringAfterLast("/")
|
||||||
return listOf(chapter)
|
chapter_number = 1f
|
||||||
|
|
||||||
|
date_upload = response.asJsoup().select(".stat-container div:contains(Uploaded) div.bold")?.text().let {
|
||||||
|
DATE_FORMAT.parse(it!!)?.time
|
||||||
|
} ?: 0L
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun chapterListSelector() = "not used"
|
override fun chapterListSelector() = "not used"
|
||||||
|
@ -199,4 +209,10 @@ abstract class SimplyHentai(
|
||||||
SearchPair("Granblue Fantasy", "2041"),
|
SearchPair("Granblue Fantasy", "2041"),
|
||||||
SearchPair("Girls Und Panzer", "1324")
|
SearchPair("Girls Und Panzer", "1324")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
private val DATE_FORMAT = SimpleDateFormat("dd.MM.yyyy")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue