This commit is contained in:
AntsyLich 2024-01-22 20:20:11 +06:00
parent 89ea0a271b
commit 58085336a5
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -4,7 +4,6 @@ import eu.kanade.tachiyomi.BuildConfig
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import okhttp3.FormBody import okhttp3.FormBody
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@ -32,7 +31,10 @@ class BangumiInterceptor(private val bangumi: Bangumi) : Interceptor {
} }
return originalRequest.newBuilder() return originalRequest.newBuilder()
.header("User-Agent", "antsylich/Mihon/v${BuildConfig.VERSION_NAME} (Android) (http://github.com/mihonapp/mihon)") .header(
"User-Agent",
"antsylich/Mihon/v${BuildConfig.VERSION_NAME} (Android) (http://github.com/mihonapp/mihon)",
)
.apply { .apply {
if (originalRequest.method == "GET") { if (originalRequest.method == "GET") {
val newUrl = originalRequest.url.newBuilder() val newUrl = originalRequest.url.newBuilder()

View file

@ -51,7 +51,9 @@ class KomgaApi(
} }
val progress = client val progress = client
.newCall(GET("${url.replace("/api/v1/series/", "/api/v2/series/")}/read-progress/tachiyomi", headers)) .newCall(
GET("${url.replace("/api/v1/series/", "/api/v2/series/")}/read-progress/tachiyomi", headers),
)
.awaitSuccess().let { .awaitSuccess().let {
with(json) { with(json) {
if (url.contains("/api/v1/series/")) { if (url.contains("/api/v1/series/")) {