Hentairead: fix results (#1739)

This commit is contained in:
AwkwardPeak7 2024-03-09 07:18:57 +05:00 committed by Draff
parent 8ec772ebbe
commit a2e3223685
2 changed files with 39 additions and 8 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.Hentairead'
themePkg = 'madara'
baseUrl = 'https://hentairead.com'
overrideVersionCode = 3
overrideVersionCode = 4
isNsfw = true
}

View File

@ -2,10 +2,16 @@ package eu.kanade.tachiyomi.extension.en.hentairead
import android.net.Uri
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.Response
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.UpdateStrategy
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
import org.jsoup.nodes.Document
import rx.Observable
import java.text.SimpleDateFormat
import java.util.Locale
@ -13,6 +19,22 @@ class Hentairead : Madara("HentaiRead", "https://hentairead.com", "en", dateForm
override val versionId: Int = 2
override val mangaSubString = "hentai"
override val fetchGenres = false
override fun getFilterList() = FilterList()
override fun searchLoadMoreRequest(page: Int, query: String, filters: FilterList): Request {
val url = "$baseUrl${searchPage(page)}".toHttpUrl().newBuilder()
.addQueryParameter("s", query)
.addQueryParameter("post_type", "wp-manga")
.build()
return GET(url, headers)
}
override fun searchMangaSelector() = "div.c-tabs-item div.page-item-detail"
override val mangaDetailsSelectorDescription = "div.post-sub-title.alt-title > h2"
override val mangaDetailsSelectorAuthor = "div.post-meta.post-tax-wp-manga-artist > span.post-tags > a > span.tag-name"
override val mangaDetailsSelectorArtist = "div.post-meta.post-tax-wp-manga-artist > span.post-tags > a > span.tag-name"
@ -21,6 +43,13 @@ class Hentairead : Madara("HentaiRead", "https://hentairead.com", "en", dateForm
override val pageListParseSelector = "li.chapter-image-item > a > div.image-wrapper"
override fun mangaDetailsParse(document: Document): SManga {
return super.mangaDetailsParse(document).apply {
update_strategy = UpdateStrategy.ONLY_FETCH_ONCE
status = SManga.COMPLETED
}
}
override fun pageListParse(document: Document): List<Page> {
launchIO { countViews(document) }
@ -37,12 +66,14 @@ class Hentairead : Madara("HentaiRead", "https://hentairead.com", "en", dateForm
}
}
override fun chapterListParse(response: Response): List<SChapter> {
return listOf(
SChapter.create().apply {
name = "Chapter"
setUrlWithoutDomain(response.request.url.encodedPath)
},
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
return Observable.just(
listOf(
SChapter.create().apply {
name = "Chapter"
url = manga.url
},
),
)
}
}