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
This commit is contained in:
mobi2002 2022-12-29 21:01:23 +05:00 committed by GitHub
parent 3a4982defd
commit 2cc30fb009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 51 deletions

View File

@ -15,11 +15,11 @@
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="comick.fun"
android:host="comick.app"
android:pathPattern="/comic/.*/..*"
android:scheme="https" />
<data
android:host="comick.fun"
android:host="comick.app"
android:pathPattern="/comic/..*"
android:scheme="https" />
</intent-filter>

View File

@ -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
}

View File

@ -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
)
}

View File

@ -11,47 +11,52 @@ val legacyLanguageMappings = mapOf(
).withDefault { it } // country code matches language code
class ComickFunFactory : SourceFactory {
override fun createSources(): List<Source> = 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<Source> = idMap.keys.map {
object : ComickFun(legacyLanguageMappings.getValue(it), it) {
override val id: Long = idMap[it]!!
}
}
}