Cuong M. Tran e4a62d0fc7
Update Manhwa18/Manhwa18.net, Manhwaraw.com (#19516)
* Fix ManyToon.me & ManyToon.club

Fix issues in which both sources unable to load any mangas.

Closes #16612

* Update multisrc MyMangaCMS to support other site’s langugae

Also, support a second alternative name and remove generic words like “manhwa”, “engsub” from those names.
Also, mark TruyenTranhLH as NSFW

* Move Manhwa18 & Manhwa18.net to MyMangaCMS theme.
Also fix Manhwa18.net’s searching issue with the previous theme.
Also allow Manhwa18’s filter working since it was not with the previous theme.

Close #18818

* Remove unused import causing PR build check to fail

* MyMangaCms

Bump the `versionId` so the ID will change and users will be forced to migrate to update the URLs.

* fix locale friendly

* Fix Manhwaraw.com won’t show Popular & Latest manhwa

* revert bumping TruyenTranhLH’s version
2024-01-01 18:03:26 -03:00

63 lines
2.0 KiB
Kotlin

package eu.kanade.tachiyomi.extension.all.manhwa18net
import eu.kanade.tachiyomi.multisrc.mymangacms.MyMangaCMS
import eu.kanade.tachiyomi.source.model.FilterList
class Manhwa18Net : MyMangaCMS("Manhwa18.net", "https://manhwa18.net", "en") {
// Migrated from FMReader to MyMangaCms.
override val versionId = 2
override val parseAuthorString = "Author"
override val parseAlternativeNameString = "Other name"
override val parseAlternative2ndNameString = "Doujinshi"
override val parseStatusString = "Status"
override val parseStatusOngoingStringLowerCase = "on going"
override val parseStatusOnHoldStringLowerCase = "on hold"
override val parseStatusCompletedStringLowerCase = "completed"
override fun getFilterList(): FilterList = FilterList(
Author("Author"),
Status(
"Status",
"All",
"Ongoing",
"On hold",
"Completed",
),
Sort(
"Order",
"A-Z",
"Z-A",
"Latest update",
"New manhwa",
"Most view",
"Most like",
),
GenreList(getGenreList(), "Genre"),
)
// To populate this list:
// console.log([...document.querySelectorAll("div.search-gerne_item")].map(elem => `Genre("${elem.textContent.trim()}", ${elem.querySelector("label").getAttribute("data-genre-id")}),`).join("\n"))
override fun getGenreList() = listOf(
Genre("Adult", 4),
Genre("Doujinshi", 9),
Genre("Harem", 17),
Genre("Manga", 24),
Genre("Manhwa", 26),
Genre("Mature", 28),
Genre("NTR", 33),
Genre("Romance", 36),
Genre("Webtoon", 57),
Genre("Action", 59),
Genre("Comedy", 60),
Genre("BL", 61),
Genre("Horror", 62),
Genre("Raw", 63),
Genre("Uncensore", 64),
)
override fun dateUpdatedParser(date: String): Long =
runCatching { dateFormatter.parse(date.substringAfter(" - "))?.time }.getOrNull() ?: 0L
}