diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index 71c3acdf2d..caa6fefdc9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -20,23 +20,11 @@ internal class ExtensionGithubApi { private val networkService: NetworkHelper by injectLazy() - private var requiresFallbackSource = false - suspend fun findExtensions(): List { return withIOContext { - val response = try { - networkService.client - .newCall(GET("${REPO_URL_PREFIX}index.min.json")) - .await() - } catch (e: Throwable) { - requiresFallbackSource = true - - networkService.client - .newCall(GET("${FALLBACK_REPO_URL_PREFIX}index.min.json")) - .await() - } - - response + networkService.client + .newCall(GET("${REPO_URL_PREFIX}index.min.json")) + .await() .parseAs() .let { parseResponse(it) } } @@ -80,23 +68,15 @@ internal class ExtensionGithubApi { val versionCode = element.jsonObject["code"]!!.jsonPrimitive.int val lang = element.jsonObject["lang"]!!.jsonPrimitive.content val nsfw = element.jsonObject["nsfw"]!!.jsonPrimitive.int == 1 - val icon = "${getUrlPrefix()}icon/${apkName.replace(".apk", ".png")}" + val icon = "${REPO_URL_PREFIX}icon/${apkName.replace(".apk", ".png")}" Extension.Available(name, pkgName, versionName, versionCode, lang, nsfw, apkName, icon) } } fun getApkUrl(extension: ExtensionManager.ExtensionInfo): String { - return "${getUrlPrefix()}apk/${extension.apkName}" - } - - private fun getUrlPrefix(): String { - return when (requiresFallbackSource) { - true -> FALLBACK_REPO_URL_PREFIX - false -> REPO_URL_PREFIX - } + return "${REPO_URL_PREFIX}apk/${extension.apkName}" } } private const val REPO_URL_PREFIX = "https://raw.githubusercontent.com/tachiyomiorg/tachiyomi-extensions/repo/" -private const val FALLBACK_REPO_URL_PREFIX = "https://cdn.jsdelivr.net/gh/tachiyomiorg/tachiyomi-extensions@repo/"