From 0db45877b7e22f35189f235d97b500627f0b2240 Mon Sep 17 00:00:00 2001 From: Draken <131387159+dragonx943@users.noreply.github.com> Date: Sat, 31 May 2025 18:12:40 +0700 Subject: [PATCH] [SolarMTL] Add source (#1826) --- .github/summary.yaml | 2 +- .../site/en/{SnowMTL.kt => MTL/MTLParser.kt} | 13 +++++++------ .../koitharu/kotatsu/parsers/site/en/MTL/SnowMTL.kt | 11 +++++++++++ .../kotatsu/parsers/site/en/MTL/SolarMTL.kt | 11 +++++++++++ 4 files changed, 30 insertions(+), 7 deletions(-) rename src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/{SnowMTL.kt => MTL/MTLParser.kt} (95%) create mode 100644 src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SnowMTL.kt create mode 100644 src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SolarMTL.kt diff --git a/.github/summary.yaml b/.github/summary.yaml index 52427c46..6d10807e 100644 --- a/.github/summary.yaml +++ b/.github/summary.yaml @@ -1 +1 @@ -total: 1232 \ No newline at end of file +total: 1233 \ No newline at end of file diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/SnowMTL.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/MTLParser.kt similarity index 95% rename from src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/SnowMTL.kt rename to src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/MTLParser.kt index 5cbf9dc6..4ccd88b8 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/SnowMTL.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/MTLParser.kt @@ -1,10 +1,9 @@ -package org.koitharu.kotatsu.parsers.site.en +package org.koitharu.kotatsu.parsers.site.en.MTL import org.json.JSONArray import org.json.JSONObject import org.jsoup.nodes.Document import org.koitharu.kotatsu.parsers.MangaLoaderContext -import org.koitharu.kotatsu.parsers.MangaSourceParser import org.koitharu.kotatsu.parsers.model.* import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities @@ -18,11 +17,13 @@ import org.koitharu.kotatsu.parsers.exception.ParseException import java.text.SimpleDateFormat import java.util.* -@MangaSourceParser("SNOWMTL", "SnowMtl", "en", ContentType.OTHER) -internal class SnowMTL(context: MangaLoaderContext): - PagedMangaParser(context, MangaParserSource.SNOWMTL, 24) { +internal abstract class MTLParser( + context: MangaLoaderContext, + source: MangaParserSource, + domain: String +): PagedMangaParser(context, source, 24) { - override val configKeyDomain = ConfigKey.Domain("snowmtl.ru") + override val configKeyDomain = ConfigKey.Domain(domain) override val availableSortOrders: Set = EnumSet.of( SortOrder.UPDATED, diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SnowMTL.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SnowMTL.kt new file mode 100644 index 00000000..48d3d47f --- /dev/null +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SnowMTL.kt @@ -0,0 +1,11 @@ +package org.koitharu.kotatsu.parsers.site.en.MTL + +import org.koitharu.kotatsu.parsers.MangaLoaderContext +import org.koitharu.kotatsu.parsers.MangaSourceParser +import org.koitharu.kotatsu.parsers.model.MangaParserSource +import org.koitharu.kotatsu.parsers.model.ContentType +import org.koitharu.kotatsu.parsers.site.en.MTL.MTLParser + +@MangaSourceParser("SNOWMTL", "SnowMTL", "en", type = ContentType.OTHER) +internal class SnowMTL(context: MangaLoaderContext): + MTLParser(context, source = MangaParserSource.SNOWMTL, "snowmtl.ru") \ No newline at end of file diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SolarMTL.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SolarMTL.kt new file mode 100644 index 00000000..34e91c3a --- /dev/null +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/en/MTL/SolarMTL.kt @@ -0,0 +1,11 @@ +package org.koitharu.kotatsu.parsers.site.en.MTL + +import org.koitharu.kotatsu.parsers.MangaLoaderContext +import org.koitharu.kotatsu.parsers.MangaSourceParser +import org.koitharu.kotatsu.parsers.model.MangaParserSource +import org.koitharu.kotatsu.parsers.model.ContentType +import org.koitharu.kotatsu.parsers.site.en.MTL.MTLParser + +@MangaSourceParser("SOLARMTL", "SolarMTL", "en", type = ContentType.MANGA) +internal class SolarMTL(context: MangaLoaderContext): + MTLParser(context, source = MangaParserSource.SOLARMTL, "solarmtl.com") \ No newline at end of file