Manhuarock domain name update & fix chapter date upload and manga status (#9049)

* Manhuarock domain name update & minor changes

* use tryParse

* Update Missing Genre

* Fix build
This commit is contained in:
are-are-are 2025-06-03 09:20:42 +07:00 committed by Draff
parent 57cf47f154
commit 2a2157d48b
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 41 additions and 9 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = "ManhuaRock"
extClass = ".ManhuaRock"
extVersionCode = 13
extVersionCode = 14
}
apply from: "$rootDir/common.gradle"

View File

@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import keiyoushi.utils.getPreferences
import keiyoushi.utils.tryParse
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
@ -40,7 +41,7 @@ class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
override val lang = "vi"
private val defaultBaseUrl = "https://manhuarock1.site"
private val defaultBaseUrl = "https://manhuarock.site"
override val baseUrl by lazy { getPrefBaseUrl() }
@ -54,7 +55,7 @@ class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
private val json: Json by injectLazy()
private val dateFormat by lazy {
SimpleDateFormat("dd MMM yyyy", Locale.US).apply {
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).apply {
timeZone = TimeZone.getTimeZone("Asia/Ho_Chi_Minh")
}
}
@ -117,7 +118,7 @@ class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
status = when (document.selectFirst("div.summary-heading:contains(Tình Trạng) + div.summary-content")?.text()) {
// I have zero idea what the strings for Ongoing and Completed are, these are educated guesses
// All the metadata on this page is basically "Unknown".
"Đang Ra" -> SManga.ONGOING
"Đang Tiến Hành" -> SManga.ONGOING
"Hoàn Thành" -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
@ -131,11 +132,7 @@ class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
setUrlWithoutDomain(a.attr("abs:href"))
name = a.text()
date_upload = runCatching {
val date = element.selectFirst("span.chapter-time")!!.text()
dateFormat.parse(date)!!.time
}.getOrDefault(0L)
date_upload = dateFormat.tryParse(element.select("span.chapter-time").attr("data-last-update"))
}
override fun pageListRequest(chapter: SChapter): Request {
@ -216,41 +213,76 @@ class ManhuaRock : ParsedHttpSource(), ConfigurableSource {
private fun getGenreList() = arrayOf(
Slug("Tất cả", "tat-ca-truyen"),
Slug("Hoàn thành", "hoan-thanh"),
Slug("Yuri", "the-loai/yuri"),
Slug("Xuyên Không", "the-loai/xuyen-khong"),
Slug("Webtoon", "the-loai/webtoons"),
Slug("Webtoon", "the-loai/webtoon"),
Slug("Võ Thuật", "the-loai/vo-thuat"),
Slug("Võ Lâm", "the-loai/vo-lam"),
Slug("Viễn Tưởng", "the-loai/vien-tuong"),
Slug("Tu Tiên", "the-loai/tu-tien"),
Slug("Truyện Trung", "the-loai/truyen-trung"),
Slug("Truyện Màu", "the-loai/truyen-mau"),
Slug("Trùng Sinh", "the-loai/trung-sinh"),
Slug("Trọng Sinh", "the-loai/trong-sinh"),
Slug("Tragedy", "the-loai/tragedy"),
Slug("Supernatural", "the-loai/supernatural"),
Slug("Sports", "the-loai/sports"),
Slug("Slice Of Life", "the-loai/slice-of-life"),
Slug("Siêu Nhiên", "the-loai/sieu-nhien"),
Slug("Shounen Ai", "the-loai/shounen-ai"),
Slug("Shounen", "the-loai/shounen"),
Slug("Shoujo", "the-loai/shoujo"),
Slug("Seinen", "the-loai/seinen"),
Slug("Sci-Fi", "the-loai/sci-fi"),
Slug("School Life", "the-loai/school-life"),
Slug("Romance", "the-loai/romance"),
Slug("Psychological", "the-loai/psychological"),
Slug("Phiêu Lưu", "the-loai/phieu-luu"),
Slug("One Shot", "the-loai/one-shot"),
Slug("Ngôn Tình", "the-loai/ngon-tinh"),
Slug("Mystery", "the-loai/mystery"),
Slug("Murim", "the-loai/murim"),
Slug("Mecha", "the-loai/mecha"),
Slug("Mature", "the-loai/mature"),
Slug("Mạt thế", "the-loai/mat-the"),
Slug("Martial Arts", "the-loai/martial-arts"),
Slug("Manhwa", "the-loai/manhwa"),
Slug("Manhua", "the-loai/manhua"),
Slug("Manga", "the-loai/manga"),
Slug("Magic", "the-loai/magic"),
Slug("Lịch Sử", "the-loai/lich-su"),
Slug("Leo Tháp", "the-loai/leo-thap"),
Slug("Lãng Mạn", "the-loai/lang-man"),
Slug("Kinh Dị", "the-loai/kinh-di"),
Slug("Khoa Học", "the-loai/khoa-hoc"),
Slug("Josei", "the-loai/josei"),
Slug("Isekai", "the-loai/isekai"),
Slug("Huyền Huyễn", "the-loai/huyen-huyen"),
Slug("Huyền Bí", "the-loai/huyen-bi"),
Slug("Horror", "the-loai/horror"),
Slug("Học Đường", "the-loai/hoc-duong"),
Slug("Historical", "the-loai/historical"),
Slug("Hiện Đại", "the-loai/hien-dai"),
Slug("Hệ Thống", "the-loai/he-thong"),
Slug("Harem", "the-loai/harem"),
Slug("Hành Động", "the-loai/hanh-dong"),
Slug("Hầm Ngục", "the-loai/ham-nguc"),
Slug("Hài Hước", "the-loai/hai-huoc"),
Slug("Gyaru", "the-loai/gyaru"),
Slug("Gender Bender", "the-loai/gender-bender"),
Slug("Game", "the-loai/game"),
Slug("Gal", "the-loai/gal"),
Slug("Fantasy", "the-loai/fantasy"),
Slug("Ecchi", "the-loai/ecchi"),
Slug("Drama", "the-loai/drama"),
Slug("Doujinshi", "the-loai/doujinshi"),
Slug("Detective", "the-loai/detective"),
Slug("Demons", "the-loai/demons"),
Slug("Comedy", "the-loai/comedy"),
Slug("Cổ Đại", "the-loai/co-dai"),
Slug("Chuyển Sinh", "the-loai/chuyen-sinh"),
Slug("Bạo Lực", "the-loai/bao-luc"),
Slug("Anime", "the-loai/anime"),
Slug("Adventure", "the-loai/adventure"),
Slug("Adult", "the-loai/adult"),