diff --git a/src/en/hentairead/build.gradle b/src/en/hentairead/build.gradle index 5d7dc0138..970bf605e 100644 --- a/src/en/hentairead/build.gradle +++ b/src/en/hentairead/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.Hentairead' themePkg = 'madara' baseUrl = 'https://hentairead.com' - overrideVersionCode = 3 + overrideVersionCode = 4 isNsfw = true } diff --git a/src/en/hentairead/src/eu/kanade/tachiyomi/extension/en/hentairead/Hentairead.kt b/src/en/hentairead/src/eu/kanade/tachiyomi/extension/en/hentairead/Hentairead.kt index 24a817a08..7a11fa604 100644 --- a/src/en/hentairead/src/eu/kanade/tachiyomi/extension/en/hentairead/Hentairead.kt +++ b/src/en/hentairead/src/eu/kanade/tachiyomi/extension/en/hentairead/Hentairead.kt @@ -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 { launchIO { countViews(document) } @@ -37,12 +66,14 @@ class Hentairead : Madara("HentaiRead", "https://hentairead.com", "en", dateForm } } - override fun chapterListParse(response: Response): List { - return listOf( - SChapter.create().apply { - name = "Chapter" - setUrlWithoutDomain(response.request.url.encodedPath) - }, + override fun fetchChapterList(manga: SManga): Observable> { + return Observable.just( + listOf( + SChapter.create().apply { + name = "Chapter" + url = manga.url + }, + ), ) } }