From 2cc30fb00954b8a88a8e8fc0bc7631bdb4135b3c Mon Sep 17 00:00:00 2001
From: mobi2002 <48650614+mobi2002@users.noreply.github.com>
Date: Thu, 29 Dec 2022 21:01:23 +0500
Subject: [PATCH] Comick.fun: fix filters and change domain (#14717)
* Comick: fix filters only showing first page
* Comick: change domain
* Comick: change extension name but keep ids
---
src/all/comickfun/AndroidManifest.xml | 4 +-
src/all/comickfun/build.gradle | 4 +-
.../extension/all/comickfun/ComickFun.kt | 8 +-
.../all/comickfun/ComickFunFactory.kt | 91 ++++++++++---------
4 files changed, 56 insertions(+), 51 deletions(-)
diff --git a/src/all/comickfun/AndroidManifest.xml b/src/all/comickfun/AndroidManifest.xml
index 50803f5b7..141145206 100644
--- a/src/all/comickfun/AndroidManifest.xml
+++ b/src/all/comickfun/AndroidManifest.xml
@@ -15,11 +15,11 @@
diff --git a/src/all/comickfun/build.gradle b/src/all/comickfun/build.gradle
index 6376cec84..0e1ea3497 100644
--- a/src/all/comickfun/build.gradle
+++ b/src/all/comickfun/build.gradle
@@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
ext {
- extName = 'Comick.fun'
+ extName = 'Comick'
pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory'
- extVersionCode = 17
+ extVersionCode = 18
isNsfw = true
}
diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt
index d5c5f92ff..2212dba2c 100644
--- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt
+++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFun.kt
@@ -19,13 +19,13 @@ import okhttp3.Response
import rx.Observable
import java.text.SimpleDateFormat
-const val API_BASE = "https://api.comick.fun"
+const val API_BASE = "https://api.comick.app"
abstract class ComickFun(override val lang: String, private val comickFunLang: String) : HttpSource() {
- override val name = "Comick.fun"
+ override val name = "Comick"
- override val baseUrl = "https://comick.fun"
+ override val baseUrl = "https://comick.app"
override val supportsLatest = true
@@ -189,7 +189,7 @@ abstract class ComickFun(override val lang: String, private val comickFunLang: S
thumbnail_url = data.cover_url
}
},
- hasNextPage = result.size >= 50
+ hasNextPage = result.size >= 30
)
}
diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunFactory.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunFactory.kt
index a60d02778..3368d84b4 100644
--- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunFactory.kt
+++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/ComickFunFactory.kt
@@ -11,47 +11,52 @@ val legacyLanguageMappings = mapOf(
).withDefault { it } // country code matches language code
class ComickFunFactory : SourceFactory {
- override fun createSources(): List = listOf(
- "all",
- "en",
- "pt-br",
- "ru",
- "fr",
- "es-419",
- "pl",
- "tr",
- "it",
- "es",
- "id",
- "hu",
- "vi",
- "zh-hk",
- "ar",
- "de",
- "zh",
- "ca",
- "bg",
- "th",
- "fa",
- "uk",
- "mn",
- "ro",
- "he",
- "ms",
- "tl",
- "ja",
- "hi",
- "my",
- "ko",
- "cs",
- "pt",
- "nl",
- "sv",
- "bn",
- "no",
- "lt",
- "el",
- "sr",
- "da"
- ).map { object : ComickFun(legacyLanguageMappings.getValue(it), it) {} }
+ private val idMap = listOf(
+ "all" to 982606170401027267,
+ "en" to 2971557565147974499,
+ "pt-br" to 8729626158695297897,
+ "ru" to 5846182885417171581,
+ "fr" to 9126078936214680667,
+ "es-419" to 3182432228546767958,
+ "pl" to 7005108854993254607,
+ "tr" to 7186425300860782365,
+ "it" to 8807318985460553537,
+ "es" to 9052019484488287695,
+ "id" to 5506707690027487154,
+ "hu" to 7838940669485160901,
+ "vi" to 9191587139933034493,
+ "zh-hk" to 3140511316190656180,
+ "ar" to 8266599095155001097,
+ "de" to 7552236568334706863,
+ "zh" to 1071494508319622063,
+ "ca" to 2159382907508433047,
+ "bg" to 8981320463367739957,
+ "th" to 4246541831082737053,
+ "fa" to 3146252372540608964,
+ "uk" to 3505068018066717349,
+ "mn" to 2147260678391898600,
+ "ro" to 6676949771764486043,
+ "he" to 5354540502202034685,
+ "ms" to 4731643595200952045,
+ "tl" to 8549617092958820123,
+ "ja" to 8288710818308434509,
+ "hi" to 5176570178081213805,
+ "my" to 9199495862098963317,
+ "ko" to 3493720175703105662,
+ "cs" to 2651978322082769022,
+ "pt" to 4153491877797434408,
+ "nl" to 6104206360977276112,
+ "sv" to 979314012722687145,
+ "bn" to 3598159956413889411,
+ "no" to 5932005504194733317,
+ "lt" to 1792260331167396074,
+ "el" to 6190162673651111756,
+ "sr" to 571668187470919545,
+ "da" to 7137437402245830147
+ ).toMap()
+ override fun createSources(): List = idMap.keys.map {
+ object : ComickFun(legacyLanguageMappings.getValue(it), it) {
+ override val id: Long = idMap[it]!!
+ }
+ }
}