Koharu: Fix Pages (#4256)

* Fix Pages

* LF
This commit is contained in:
KenjieDec 2024-07-27 12:26:32 +07:00 committed by Draff
parent 2f9ebadb08
commit 88fffed4f9
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Koharu'
extClass = '.Koharu'
extVersionCode = 3
extVersionCode = 4
isNsfw = true
}

View File

@ -6,7 +6,6 @@ import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen
import androidx.preference.SwitchPreferenceCompat
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.FilterList
@ -78,8 +77,15 @@ class Koharu : HttpSource(), ConfigurableSource {
"780" -> data.`780` ?: data.`980` ?: data.`0`
else -> data.`0`
}
val realQuality = when (dataKey) {
data.`1600` -> "1600"
data.`1280` -> "1280"
data.`980` -> "980"
data.`780` -> "780"
else -> "1600"
}
val imagesResponse = client.newCall(POST("$apiBooksUrl/data/${entry.id}/${entry.public_key}/${dataKey.id}/${dataKey.public_key}", headers)).execute()
val imagesResponse = client.newCall(GET("$apiBooksUrl/data/${entry.id}/${entry.public_key}/${dataKey.id}/${dataKey.public_key}?v=${entry.updated_at}&w=$realQuality", headers)).execute()
val images = imagesResponse.parseAs<ImagesInfo>()
return images
}