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" /> <category android:name="android.intent.category.BROWSABLE" />
<data <data
android:host="comick.fun" android:host="comick.app"
android:pathPattern="/comic/.*/..*" android:pathPattern="/comic/.*/..*"
android:scheme="https" /> android:scheme="https" />
<data <data
android:host="comick.fun" android:host="comick.app"
android:pathPattern="/comic/..*" android:pathPattern="/comic/..*"
android:scheme="https" /> android:scheme="https" />
</intent-filter> </intent-filter>

View File

@ -3,10 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization' apply plugin: 'kotlinx-serialization'
ext { ext {
extName = 'Comick.fun' extName = 'Comick'
pkgNameSuffix = 'all.comickfun' pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory' extClass = '.ComickFunFactory'
extVersionCode = 17 extVersionCode = 18
isNsfw = true isNsfw = true
} }

View File

@ -19,13 +19,13 @@ import okhttp3.Response
import rx.Observable import rx.Observable
import java.text.SimpleDateFormat 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() { 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 override val supportsLatest = true
@ -189,7 +189,7 @@ abstract class ComickFun(override val lang: String, private val comickFunLang: S
thumbnail_url = data.cover_url 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 ).withDefault { it } // country code matches language code
class ComickFunFactory : SourceFactory { class ComickFunFactory : SourceFactory {
override fun createSources(): List<Source> = listOf( private val idMap = listOf(
"all", "all" to 982606170401027267,
"en", "en" to 2971557565147974499,
"pt-br", "pt-br" to 8729626158695297897,
"ru", "ru" to 5846182885417171581,
"fr", "fr" to 9126078936214680667,
"es-419", "es-419" to 3182432228546767958,
"pl", "pl" to 7005108854993254607,
"tr", "tr" to 7186425300860782365,
"it", "it" to 8807318985460553537,
"es", "es" to 9052019484488287695,
"id", "id" to 5506707690027487154,
"hu", "hu" to 7838940669485160901,
"vi", "vi" to 9191587139933034493,
"zh-hk", "zh-hk" to 3140511316190656180,
"ar", "ar" to 8266599095155001097,
"de", "de" to 7552236568334706863,
"zh", "zh" to 1071494508319622063,
"ca", "ca" to 2159382907508433047,
"bg", "bg" to 8981320463367739957,
"th", "th" to 4246541831082737053,
"fa", "fa" to 3146252372540608964,
"uk", "uk" to 3505068018066717349,
"mn", "mn" to 2147260678391898600,
"ro", "ro" to 6676949771764486043,
"he", "he" to 5354540502202034685,
"ms", "ms" to 4731643595200952045,
"tl", "tl" to 8549617092958820123,
"ja", "ja" to 8288710818308434509,
"hi", "hi" to 5176570178081213805,
"my", "my" to 9199495862098963317,
"ko", "ko" to 3493720175703105662,
"cs", "cs" to 2651978322082769022,
"pt", "pt" to 4153491877797434408,
"nl", "nl" to 6104206360977276112,
"sv", "sv" to 979314012722687145,
"bn", "bn" to 3598159956413889411,
"no", "no" to 5932005504194733317,
"lt", "lt" to 1792260331167396074,
"el", "el" to 6190162673651111756,
"sr", "sr" to 571668187470919545,
"da" "da" to 7137437402245830147
).map { object : ComickFun(legacyLanguageMappings.getValue(it), it) {} } ).toMap()
override fun createSources(): List<Source> = idMap.keys.map {
object : ComickFun(legacyLanguageMappings.getValue(it), it) {
override val id: Long = idMap[it]!!
}
}
} }