update ManhuaID (#5212)

update icons
fix title in mangaDetails 
clean code a little bit
This commit is contained in:
Riztard Lanthorn 2020-12-20 22:07:06 +07:00 committed by GitHub
parent f84fef686b
commit 79b4573c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'ManhuaID'
pkgNameSuffix = 'id.manhuaid'
extClass = '.ManhuaID'
extVersionCode = 3
extVersionCode = 4
libVersion = '1.2'
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -26,6 +26,7 @@ class ManhuaID : ParsedHttpSource() {
override val client: OkHttpClient = network.cloudflareClient
// popular
override fun popularMangaSelector() = "a:has(img.card-img)"
override fun popularMangaRequest(page: Int) = GET("$baseUrl/popular/$page", headers)
@ -38,6 +39,7 @@ class ManhuaID : ParsedHttpSource() {
override fun popularMangaNextPageSelector() = "[rel=nofollow]"
// latest
override fun latestUpdatesSelector() = popularMangaSelector()
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/latest/$page", headers)
@ -46,6 +48,7 @@ class ManhuaID : ParsedHttpSource() {
override fun latestUpdatesNextPageSelector() = popularMangaNextPageSelector()
// search
override fun searchMangaSelector() = popularMangaSelector()
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/search?q=$query", headers)
@ -54,11 +57,10 @@ class ManhuaID : ParsedHttpSource() {
override fun searchMangaNextPageSelector(): String? = null
override fun mangaDetailsRequest(manga: SManga) = GET(baseUrl + manga.url, headers)
// manga details
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
author = document.select("table").first().select("td")[3].text()
title = document.select("title").text()
title = document.select("h1").text()
description = document.select(".text-justify").text()
genre = document.select("span.badge.badge-success.mr-1.mb-1").joinToString { it.text() }
status = document.select("td > span.badge.badge-success").text().let {
@ -73,6 +75,7 @@ class ManhuaID : ParsedHttpSource() {
else -> SManga.UNKNOWN
}
// chapters
override fun chapterListSelector() = "table.table tr td:first-of-type a"
override fun chapterListParse(response: Response): List<SChapter> {
@ -91,13 +94,12 @@ class ManhuaID : ParsedHttpSource() {
return SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH).parse(date)?.time ?: 0L
}
override fun chapterListRequest(manga: SManga) = GET(baseUrl + manga.url, headers)
override fun chapterFromElement(element: Element) = SChapter.create().apply {
setUrlWithoutDomain(element.attr("href"))
name = element.text()
}
// pages
override fun pageListParse(document: Document): List<Page> {
return document.select("img.img-fluid.mb-0.mt-0").mapIndexed { i, element ->
Page(i, "", element.attr("src"))
@ -105,6 +107,4 @@ class ManhuaID : ParsedHttpSource() {
}
override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException("Not Used")
override fun getFilterList() = FilterList()
}