From 14072bb5a0b7922de08fb15fb5809b344b7f8e76 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Thu, 17 Jun 2021 00:26:34 +0430 Subject: [PATCH] fix manga extensions not loading --- .../anime/impl/extension/github/ExtensionGithubApi.kt | 6 +++--- .../manga/impl/extension/github/ExtensionGithubApi.kt | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/anime/impl/extension/github/ExtensionGithubApi.kt b/server/src/main/kotlin/suwayomi/tachidesk/anime/impl/extension/github/ExtensionGithubApi.kt index 452dba2..bc30373 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/anime/impl/extension/github/ExtensionGithubApi.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/anime/impl/extension/github/ExtensionGithubApi.kt @@ -20,8 +20,8 @@ import suwayomi.tachidesk.manga.impl.util.network.UnzippingInterceptor import uy.kohesive.injekt.injectLazy object ExtensionGithubApi { - const val BASE_URL = "https://raw.githubusercontent.com" - const val REPO_URL_PREFIX = "$BASE_URL/jmir1/tachiyomi-extensions/repo" + private const val BASE_URL = "https://raw.githubusercontent.com" + private const val REPO_URL_PREFIX = "$BASE_URL/jmir1/tachiyomi-extensions/repo" private fun parseResponse(json: JsonArray): List { return json @@ -68,7 +68,7 @@ object ExtensionGithubApi { .build() } - private fun getRepo(): com.google.gson.JsonArray { + private fun getRepo(): JsonArray { val request = Request.Builder() .url("$REPO_URL_PREFIX/index.json.gz") .build() diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/ExtensionGithubApi.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/ExtensionGithubApi.kt index 5c09c41..1e22c31 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/ExtensionGithubApi.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/ExtensionGithubApi.kt @@ -15,13 +15,12 @@ import eu.kanade.tachiyomi.network.NetworkHelper import okhttp3.Request import suwayomi.tachidesk.manga.impl.util.PackageTools.LIB_VERSION_MAX import suwayomi.tachidesk.manga.impl.util.PackageTools.LIB_VERSION_MIN -import suwayomi.tachidesk.manga.impl.util.network.UnzippingInterceptor import suwayomi.tachidesk.manga.model.dataclass.ExtensionDataClass import uy.kohesive.injekt.injectLazy object ExtensionGithubApi { - const val BASE_URL = "https://raw.githubusercontent.com" - const val REPO_URL_PREFIX = "$BASE_URL/tachiyomiorg/tachiyomi-extensions/repo" + private const val BASE_URL = "https://raw.githubusercontent.com" + private const val REPO_URL_PREFIX = "$BASE_URL/tachiyomiorg/tachiyomi-extensions/repo" private fun parseResponse(json: JsonArray): List { return json @@ -60,17 +59,15 @@ object ExtensionGithubApi { .addNetworkInterceptor { chain -> val originalResponse = chain.proceed(chain.request()) originalResponse.newBuilder() - .header("Content-Encoding", "gzip") .header("Content-Type", "application/json") .build() } - .addInterceptor(UnzippingInterceptor()) .build() } - private fun getRepo(): com.google.gson.JsonArray { + private fun getRepo(): JsonArray { val request = Request.Builder() - .url("$REPO_URL_PREFIX/index.json.gz") + .url("$REPO_URL_PREFIX/index.min.json") .build() val response = client.newCall(request).execute().use { response -> response.body!!.string() }