Revert "Fix duplicates in E-Hentai search 99% of the time, keep that 1% so it doesnt error"

This reverts commit fbc98ddb0ab0dfeeed47f14eba56c38b2f37b60b.
This commit is contained in:
Jobobby04 2021-05-21 21:06:45 -04:00
parent fbc98ddb0a
commit e37d4afce6

View File

@ -116,20 +116,11 @@ class EHentai(
data class ParsedManga(val fav: Int, val manga: Manga, val metadata: EHentaiSearchMetadata)
private fun extendedGenericMangaParse(doc: Document) = with(doc) {
val trim = TRIM_REGEX.find(selectFirst("p.ip")?.text().orEmpty())
?.groupValues
?.getOrNull(1)
?.replace(",", "")
?.toIntOrNull()
// So browse doesn't say it cant load any manga, always have at least 1
?.coerceAtMost(24)
?: 0
// Parse mangas (supports compact + extended layout)
val parsedMangas = select(".itg > tbody > tr").filter {
// Do not parse header and ads
it.selectFirst("th") == null && it.selectFirst(".itd") == null
}.dropLast(trim).map { body ->
}.map { body ->
val thumbnailElement = body.selectFirst(".gl1e img, .gl2c .glthumb img")
val column2 = body.selectFirst(".gl3e, .gl2c")
val linkElement = body.selectFirst(".gl3c > a, .gl2e > div > a")
@ -1025,7 +1016,6 @@ class EHentai(
private const val REVERSE_PARAM = "TEH_REVERSE"
private val PAGE_COUNT_REGEX = "[0-9]*".toRegex()
private val RATING_REGEX = "([0-9]*)px".toRegex()
private val TRIM_REGEX = "^\\D*[\\d,]*\\D*([\\d,]*)\\D*\$".toRegex()
private const val EH_API_BASE = "https://api.e-hentai.org/api.php"
private val JSON = "application/json; charset=utf-8".toMediaTypeOrNull()!!