mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix kitsu chapter progress (again)
This commit is contained in:
parent
44f2458f46
commit
fabb6ec6bd
1 changed files with 5 additions and 2 deletions
|
@ -25,7 +25,6 @@ import okhttp3.OkHttpClient
|
|||
import okhttp3.Request
|
||||
import okhttp3.RequestBody
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
import kotlin.math.min
|
||||
|
||||
class KitsuApi(private val client: OkHttpClient, interceptor: KitsuInterceptor) {
|
||||
|
||||
|
@ -84,7 +83,11 @@ class KitsuApi(private val client: OkHttpClient, interceptor: KitsuInterceptor)
|
|||
put("id", track.media_id)
|
||||
putJsonObject("attributes") {
|
||||
put("status", track.toKitsuStatus())
|
||||
put("progress", min(track.total_chapters, track.last_chapter_read.toInt()))
|
||||
val chapterCount = listOfNotNull(
|
||||
track.total_chapters.takeIf { it > 0 },
|
||||
track.last_chapter_read.toInt(),
|
||||
)
|
||||
put("progress", chapterCount.minOrNull())
|
||||
put("ratingTwenty", track.toKitsuScore())
|
||||
put("startedAt", KitsuDateHelper.convert(track.started_reading_date))
|
||||
put("finishedAt", KitsuDateHelper.convert(track.finished_reading_date))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue