ReadAllComics: re-add homepage support (#8883)
This commit is contained in:
parent
488ec7a2cd
commit
3297e41d08
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'ReadAllComics'
|
extName = 'ReadAllComics'
|
||||||
extClass = '.ReadAllComics'
|
extClass = '.ReadAllComics'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -32,16 +32,28 @@ class ReadAllComics : ParsedHttpSource() {
|
|||||||
override val client = network.cloudflareClient
|
override val client = network.cloudflareClient
|
||||||
|
|
||||||
override fun popularMangaRequest(page: Int): Request {
|
override fun popularMangaRequest(page: Int): Request {
|
||||||
throw Exception("ReadAllComics has no popular titles Page. Please use the search function instead.")
|
val url = baseUrl.toHttpUrl().newBuilder().apply {
|
||||||
|
addPathSegments("page/$page")
|
||||||
|
}.build()
|
||||||
|
|
||||||
|
return GET(url, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Never called
|
|
||||||
override fun popularMangaFromElement(element: Element): SManga {
|
override fun popularMangaFromElement(element: Element): SManga {
|
||||||
throw Exception("")
|
val manga = SManga.create().apply {
|
||||||
|
val category = element.classNames()
|
||||||
|
.firstOrNull { it.startsWith("category-") }!!
|
||||||
|
.substringAfter("category-")
|
||||||
|
setUrlWithoutDomain("/category/$category")
|
||||||
|
title = category.replace("-", " ").titleCaseWords()
|
||||||
|
thumbnail_url = element.selectFirst("img")?.attr("src")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaSelector() = ""
|
return manga
|
||||||
override fun popularMangaNextPageSelector() = ""
|
}
|
||||||
|
|
||||||
|
override fun popularMangaSelector() = "#post-area > div"
|
||||||
|
override fun popularMangaNextPageSelector() = "a.page-numbers.next"
|
||||||
|
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||||
return if (page == 1) {
|
return if (page == 1) {
|
||||||
@ -123,6 +135,11 @@ class ReadAllComics : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun String.titleCaseWords(): String {
|
||||||
|
val words = this.split(" ")
|
||||||
|
return words.joinToString(" ") { word -> word.replaceFirstChar { it.titlecase() } }
|
||||||
|
}
|
||||||
|
|
||||||
override fun imageUrlParse(document: Document) =
|
override fun imageUrlParse(document: Document) =
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
override fun latestUpdatesRequest(page: Int) =
|
override fun latestUpdatesRequest(page: Int) =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user