From fea1087e24554448cb085de1b32b2eed1dbdaceb Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Tue, 22 Oct 2024 23:08:40 -0300 Subject: [PATCH 1/3] HikariScan: Migrate theme (#5616) * Migrate theme * Remove versionId --- src/pt/hikariscan/build.gradle | 4 ++-- .../tachiyomi/extension/pt/hikariscan/HikariScan.kt | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pt/hikariscan/build.gradle b/src/pt/hikariscan/build.gradle index a8786a87f1..cf39edf6a3 100644 --- a/src/pt/hikariscan/build.gradle +++ b/src/pt/hikariscan/build.gradle @@ -1,9 +1,9 @@ ext { extName = 'Hikari Scan' extClass = '.HikariScan' - themePkg = 'mangathemesia' + themePkg = 'madara' baseUrl = 'https://hikariscan.org' - overrideVersionCode = 2 + overrideVersionCode = 0 isNsfw = true } diff --git a/src/pt/hikariscan/src/eu/kanade/tachiyomi/extension/pt/hikariscan/HikariScan.kt b/src/pt/hikariscan/src/eu/kanade/tachiyomi/extension/pt/hikariscan/HikariScan.kt index 76e96211e2..fdcf57fbe2 100644 --- a/src/pt/hikariscan/src/eu/kanade/tachiyomi/extension/pt/hikariscan/HikariScan.kt +++ b/src/pt/hikariscan/src/eu/kanade/tachiyomi/extension/pt/hikariscan/HikariScan.kt @@ -1,22 +1,20 @@ package eu.kanade.tachiyomi.extension.pt.hikariscan -import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia +import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import java.text.SimpleDateFormat import java.util.Locale -class HikariScan : MangaThemesia( +class HikariScan : Madara( "Hikari Scan", "https://hikariscan.org", "pt-BR", - dateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale("pt", "BR")), + dateFormat = SimpleDateFormat("MMM dd, yyyy", Locale("pt", "BR")), ) { override val client = super.client.newBuilder() .rateLimitHost(baseUrl.toHttpUrl(), 1, 2) .build() - // =========================== Manga Details ============================ - override val altNamePrefix = "Títulos alternativos: " - override val seriesAuthorSelector = ".tsinfo .imptdt:contains(autor) i" + override val useLoadMoreRequest = LoadMoreStrategy.Never } From a14fabf78fbb708b33ff7642260b9c9d4eb82913 Mon Sep 17 00:00:00 2001 From: kana-shii <79055104+kana-shii@users.noreply.github.com> Date: Tue, 22 Oct 2024 23:11:17 -0300 Subject: [PATCH 2/3] Clean ZinChanManga.com titles (#5646) --- src/en/zinchanmangacom/build.gradle | 2 +- .../en/zinchanmangacom/ZinChanMangaCom.kt | 48 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/en/zinchanmangacom/build.gradle b/src/en/zinchanmangacom/build.gradle index 691d771da5..867c51d542 100644 --- a/src/en/zinchanmangacom/build.gradle +++ b/src/en/zinchanmangacom/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.ZinChanMangaCom' themePkg = 'madara' baseUrl = 'https://zinchanmanga.com' - overrideVersionCode = 0 + overrideVersionCode = 1 isNsfw = true } diff --git a/src/en/zinchanmangacom/src/eu/kanade/tachiyomi/extension/en/zinchanmangacom/ZinChanMangaCom.kt b/src/en/zinchanmangacom/src/eu/kanade/tachiyomi/extension/en/zinchanmangacom/ZinChanMangaCom.kt index 6c8585cff0..ebeed75b30 100644 --- a/src/en/zinchanmangacom/src/eu/kanade/tachiyomi/extension/en/zinchanmangacom/ZinChanMangaCom.kt +++ b/src/en/zinchanmangacom/src/eu/kanade/tachiyomi/extension/en/zinchanmangacom/ZinChanMangaCom.kt @@ -1,5 +1,51 @@ package eu.kanade.tachiyomi.extension.en.zinchanmangacom import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.source.model.SManga +import org.jsoup.nodes.Document +import org.jsoup.nodes.Element -class ZinChanMangaCom : Madara("ZinChanManga.com", "https://zinchanmanga.com", "en") +class ZinChanMangaCom : Madara("ZinChanManga.com", "https://zinchanmanga.com", "en") { + override val useNewChapterEndpoint = true + + override fun popularMangaFromElement(element: Element): SManga { + return super.popularMangaFromElement(element).apply { + title = url.urlToTitle() ?: title + } + } + + override fun searchMangaFromElement(element: Element): SManga { + return super.searchMangaFromElement(element).apply { + title = url.urlToTitle() ?: title + } + } + + override fun mangaDetailsParse(document: Document): SManga { + return super.mangaDetailsParse(document).apply { + title = document.location().urlToTitle() ?: title + } + } + + private fun String.urlToTitle(): String? { + val slug = substringAfter("/manga/", "") + .substringBefore("/") + .takeUnless { it.isBlank() } + ?: return null + + val result = StringBuilder(slug.length) + var capitalize = true + for (char in slug) { + result.append( + if (char == '-') { + ' ' + } else if (capitalize) { + char.uppercase() + } else { + char.lowercase() + }, + ) + capitalize = char == '-' + } + return result.toString() + } +} From d39e0f15f57fc364937bc14c962b84213d761846 Mon Sep 17 00:00:00 2001 From: kana-shii <79055104+kana-shii@users.noreply.github.com> Date: Tue, 22 Oct 2024 23:14:44 -0300 Subject: [PATCH 3/3] MyReadingManga: add "Filed Under" to manga (#5654) Add filed under --- src/all/myreadingmanga/build.gradle | 2 +- .../tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/all/myreadingmanga/build.gradle b/src/all/myreadingmanga/build.gradle index 8523517d72..ccd0483188 100644 --- a/src/all/myreadingmanga/build.gradle +++ b/src/all/myreadingmanga/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'MyReadingManga' extClass = '.MyReadingMangaFactory' - extVersionCode = 52 + extVersionCode = 53 isNsfw = true } diff --git a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt index 16cf141025..84497f541b 100644 --- a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt +++ b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt @@ -147,7 +147,7 @@ open class MyReadingManga(override val lang: String, private val siteLang: Strin title = cleanTitle(document.select("h1").text()) author = cleanAuthor(document.select("h1").text()) artist = author - genre = document.select(".entry-header p a[href*=genre], [href*=tag]").joinToString { it.text() } + genre = document.select(".entry-header p a[href*=genre], [href*=tag], span.entry-categories a").joinToString { it.text() } val basicDescription = document.select("h1").text() // too troublesome to achieve 100% accuracy assigning scanlator group during chapterListParse val scanlatedBy = document.select(".entry-terms:has(a[href*=group])").firstOrNull()