Manga-Raw.club: Fix Chapter list & Manga details error (#9899)

* Manga-Raw.club: Fix Chapter list & Manga details error

* Manga-Raw.club: removed unnecessary chapterListParse function

* Manga-Raw.club: Updated build.gradle after merging of #9908

* Manga-Raw.club: Fix thumbnail not showing
This commit is contained in:
Davide 2021-11-24 13:55:41 +01:00 committed by GitHub
parent 4b26f2a01f
commit 716dc15a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 17 deletions

View File

@ -5,8 +5,8 @@ ext {
extName = 'manga-raw.club' extName = 'manga-raw.club'
pkgNameSuffix = 'en.mangarawclub' pkgNameSuffix = 'en.mangarawclub'
extClass = '.MangaRawClub' extClass = '.MangaRawClub'
extVersionCode = 5 extVersionCode = 6
isNsfw = true isNsfw = true
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangarawclub package eu.kanade.tachiyomi.extension.en.mangarawclub
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -90,21 +89,29 @@ class MangaRawClub : ParsedHttpSource() {
} }
manga.status = status manga.status = status
manga.description = document.getElementsByClass("description").first().text() manga.description = document.getElementsByClass("description").first().text()
val coverElement = document.getElementsByClass("cover") val coverElement = document.getElementsByClass("cover").select("img")
manga.thumbnail_url = coverElement.select("img").attr("data-src") val coverUrl = when {
coverElement.attr("data-src").isNotBlank() -> coverElement.attr("data-src")
else -> coverElement.attr("src")
}
manga.thumbnail_url = coverUrl
return manga return manga
} }
override fun chapterListSelector() = "ul.chapter-list > li" override fun chapterListSelector() = "ul.chapter-list > li"
override fun chapterFromElement(element: Element): SChapter { override fun chapterListRequest(manga: SManga): Request {
val url = baseUrl + manga.url + "all-chapters"
return GET(url, headers)
}
val urlElement = element.getElementsByTag("a").first() override fun chapterFromElement(element: Element): SChapter {
val anchor = element.select("a").first()
val chapter = SChapter.create() val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href")) chapter.setUrlWithoutDomain(anchor.attr("href"))
chapter.name = element.getElementsByClass("chapter-title").first().text() chapter.name = anchor.select(".chapter-title").first().text()
val date = element.getElementsByTag("time").first().attr("datetime") val date = anchor.select("time").first().attr("datetime")
chapter.date_upload = parseChapterDate(date) chapter.date_upload = parseChapterDate(date)
return chapter return chapter
} }
@ -115,8 +122,8 @@ class MangaRawClub : ParsedHttpSource() {
val format = "MMMMM dd, yyyy, h:mm a" val format = "MMMMM dd, yyyy, h:mm a"
val format2 = "MMMMM dd, yyyy, h a" // because sometimes if it is exact hour it wont have minutes because why not val format2 = "MMMMM dd, yyyy, h a" // because sometimes if it is exact hour it wont have minutes because why not
val sdf = SimpleDateFormat(format, Locale.ENGLISH) val sdf = SimpleDateFormat(format, Locale.ENGLISH)
try { return try {
return try { try {
val value = sdf.parse(fdate) val value = sdf.parse(fdate)
value!!.time value!!.time
} catch (e: ParseException) { } catch (e: ParseException) {
@ -125,7 +132,7 @@ class MangaRawClub : ParsedHttpSource() {
value!!.time value!!.time
} }
} catch (e: ParseException) { } catch (e: ParseException) {
return 0 0
} }
} }
@ -171,8 +178,7 @@ class MangaRawClub : ParsedHttpSource() {
} }
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
if (query.isNotEmpty()) {
if (query.length > 0) {
return GET("$baseUrl/search/?search=$query", headers) return GET("$baseUrl/search/?search=$query", headers)
} }
@ -205,8 +211,8 @@ class MangaRawClub : ParsedHttpSource() {
return GET(url.toString(), headers) return GET(url.toString(), headers)
val built = requestBody.build() // val built = requestBody.build()
return POST("$baseUrl/search", headers, requestBody.build()) // return POST("$baseUrl/search", headers, requestBody.build())
// url: String, // url: String,
// headers: Headers = DEFAULT_HEADERS, // headers: Headers = DEFAULT_HEADERS,
// body: RequestBody = DEFAULT_BODY, // body: RequestBody = DEFAULT_BODY,