From a3ef42b007fda1a0b1fcaf6a8efc4558df899c36 Mon Sep 17 00:00:00 2001 From: nicki <72807749+curche@users.noreply.github.com> Date: Wed, 15 Jun 2022 19:41:59 +0530 Subject: [PATCH] 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 --- multisrc/overrides/fmreader/mangatr/src/MangaTR.kt | 8 +++++--- .../kanade/tachiyomi/multisrc/fmreader/FMReader.kt | 12 ++++++++++-- .../tachiyomi/multisrc/fmreader/FMReaderGenerator.kt | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/multisrc/overrides/fmreader/mangatr/src/MangaTR.kt b/multisrc/overrides/fmreader/mangatr/src/MangaTR.kt index 988f0439f..224f2a95c 100644 --- a/multisrc/overrides/fmreader/mangatr/src/MangaTR.kt +++ b/multisrc/overrides/fmreader/mangatr/src/MangaTR.kt @@ -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 } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReader.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReader.kt index 762bab18b..cacf5d693 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReader.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReader.kt @@ -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 diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReaderGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReaderGenerator.kt index 1c50570e9..514e389f8 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReaderGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/fmreader/FMReaderGenerator.kt @@ -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),