ReadAllComics: re-add homepage support (#8883)

This commit is contained in:
Wyatt Ross 2025-05-18 01:35:28 -04:00 committed by Draff
parent 488ec7a2cd
commit 3297e41d08
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 23 additions and 6 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'ReadAllComics'
extClass = '.ReadAllComics'
extVersionCode = 4
extVersionCode = 5
}
apply from: "$rootDir/common.gradle"

View File

@ -32,16 +32,28 @@ class ReadAllComics : ParsedHttpSource() {
override val client = network.cloudflareClient
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 {
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() = ""
override fun popularMangaNextPageSelector() = ""
return manga
}
override fun popularMangaSelector() = "#post-area > div"
override fun popularMangaNextPageSelector() = "a.page-numbers.next"
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
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) =
throw UnsupportedOperationException()
override fun latestUpdatesRequest(page: Int) =