WorldRomanceTranslation: fix chapter name (#7857)

parsing from chapter url
This commit is contained in:
Riztard Lanthorn 2021-06-25 19:45:14 +07:00 committed by GitHub
parent e6788c88e6
commit 9df39ad62d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package eu.kanade.tachiyomi.extension.id.worldromancetranslation package eu.kanade.tachiyomi.extension.id.worldromancetranslation
import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream
import eu.kanade.tachiyomi.source.model.SChapter
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -8,4 +10,14 @@ class WorldRomanceTranslation : WPMangaStream("World Romance Translation", "http
override val projectPageString = "/project-wrt" override val projectPageString = "/project-wrt"
override val hasProjectPage = true override val hasProjectPage = true
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select(".lchx > a, span.leftoff a, div.eph-num > a").first()
val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href"))
chapter.name = "Chapter " + chapter.url.substringAfterLast("chapter-")
.replace("/", "").replace("-bahasa-indonesia", "").replace("-", ".")
chapter.date_upload = element.select("span.rightoff, time, span.chapterdate").firstOrNull()?.text()?.let { parseChapterDate(it) } ?: 0
return chapter
}
} }

View File

@ -39,7 +39,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
SingleLang("Tempest Manga", "https://manga.tempestfansub.com", "tr"), SingleLang("Tempest Manga", "https://manga.tempestfansub.com", "tr"),
SingleLang("xCaliBR Scans", "https://xcalibrscans.com", "en", overrideVersionCode = 2), SingleLang("xCaliBR Scans", "https://xcalibrscans.com", "en", overrideVersionCode = 2),
SingleLang("NoxSubs", "https://noxsubs.com", "tr"), SingleLang("NoxSubs", "https://noxsubs.com", "tr"),
SingleLang("World Romance Translation", "https://wrt.my.id/", "id", overrideVersionCode = 2), SingleLang("World Romance Translation", "https://wrt.my.id", "id", overrideVersionCode = 3),
SingleLang("The Apollo Team", "https://theapollo.team", "en"), SingleLang("The Apollo Team", "https://theapollo.team", "en"),
SingleLang("Sekte Doujin", "https://sektedoujin.xyz", "id", isNsfw = true, overrideVersionCode = 2), SingleLang("Sekte Doujin", "https://sektedoujin.xyz", "id", isNsfw = true, overrideVersionCode = 2),
SingleLang("Lemon Juice Scan", "https://lemonjuicescan.com", "pt-BR", isNsfw = true), SingleLang("Lemon Juice Scan", "https://lemonjuicescan.com", "pt-BR", isNsfw = true),