Manga TR & Fmreader: Parse Turkish Translation Statuses (#12202)

* Select Translation status in Manga-tr

selects the row and selects the second last element of the row to check
for translation status
previously it was checking raw status

* Add more strings to check Statuses

these were turkish strings as suggested by issue commentor

* increment version codes

increments mangatr because it got a fix for selecting correct Status
increments fmreader because it got new strings to parse for status
This commit is contained in:
nicki 2022-06-15 19:41:59 +05:30 committed by GitHub
parent 8c5b5522a2
commit a3ef42b007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View File

@ -47,15 +47,17 @@ class MangaTR : FMReader("Manga-TR", "https://manga-tr.com", "tr") {
override fun mangaDetailsParse(document: Document): SManga {
val manga = SManga.create()
val infoElement = document.select("div#tab1").first()
val infoElement: Element = document.select("div#tab1").first()
manga.author = infoElement.select("table + table tr + tr td a").first()?.text()
manga.artist = infoElement.select("table + table tr + tr td + td a").first()?.text()
manga.genre = infoElement.select("div#tab1 table + table tr + tr td + td + td").text()
manga.status = parseStatus(infoElement.select("div#tab1 table tr + tr td a").first().text())
manga.description = infoElement.select("div.well").text().trim()
manga.thumbnail_url = document.select("img.thumbnail").attr("abs:src")
manga.status = document.select("table.table:nth-child(2) > tbody:nth-child(1) > tr:nth-child(2) td").let {
val translationStatus = it[it.size - 2].text()
parseStatus(translationStatus)
}
return manga
}

View File

@ -184,8 +184,16 @@ abstract class FMReader(
// languages: en, vi, tr
fun parseStatus(status: String?): Int {
val completedWords = setOf("completed", "complete", "incomplete", "đã hoàn thành", "tamamlandı", "hoàn thành")
val ongoingWords = setOf("ongoing", "on going", "updating", "chưa hoàn thành", "đang cập nhật", "devam ediyor", "Đang tiến hành")
val completedWords = setOf(
"completed", "complete", "incomplete",
"đã hoàn thành", "hoàn thành",
"tamamlandı"
)
val ongoingWords = setOf(
"ongoing", "on going", "updating",
"chưa hoàn thành", "đang cập nhật", "Đang tiến hành",
"devam ediyor", "Çevirisi Bırakıldı", "Çevirisi Yok"
)
return when {
status == null -> SManga.UNKNOWN
completedWords.any { it.equals(status, ignoreCase = true) } -> SManga.COMPLETED

View File

@ -10,7 +10,7 @@ class FMReaderGenerator : ThemeSourceGenerator {
override val themeClass = "FMReader"
override val baseVersionCode: Int = 6
override val baseVersionCode: Int = 7
/** For future sources: when testing and popularMangaRequest() returns a Jsoup error instead of results
* most likely the fix is to override popularMangaNextPageSelector() */
@ -18,7 +18,7 @@ class FMReaderGenerator : ThemeSourceGenerator {
override val sources = listOf(
SingleLang("Epik Manga", "https://www.epikmanga.com", "tr"),
SingleLang("KissLove", "https://klmag.net", "ja", overrideVersionCode = 1),
SingleLang("Manga-TR", "https://manga-tr.com", "tr", className = "MangaTR"),
SingleLang("Manga-TR", "https://manga-tr.com", "tr", className = "MangaTR", overrideVersionCode = 1),
SingleLang("Manhwa18", "https://manhwa18.com", "en", isNsfw = true, overrideVersionCode = 2),
MultiLang("Manhwa18.net", "https://manhwa18.net", listOf("en", "ko"), className = "Manhwa18NetFactory", isNsfw = true),
SingleLang("WeLoveManga", "https://weloma.net", "ja", pkgName = "rawlh", overrideVersionCode = 3),