From 005ac9e7324f37b11eddbe1976c55a3a13708c95 Mon Sep 17 00:00:00 2001 From: mutsumi <4182301+mutsumi63@users.noreply.github.com> Date: Sun, 12 Jan 2020 11:05:03 +0800 Subject: [PATCH] fix bangumi track will override record to 0 after every track search(bind) (#2486) * fix bangumi track : the update status api must be called before update chapter api * fix bangumi track will override record to 0 after every track search(bind) (cherry picked from commit 427d2fed8cced3be89a2d0c1520f4fc12fb6452a) --- .../java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt | 2 +- .../java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt index 0d93e1fb73..68f924b832 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt @@ -41,7 +41,7 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) { track.library_id = remoteTrack.library_id track.status = remoteTrack.status track.last_chapter_read = remoteTrack.last_chapter_read - update(track) + refresh(track) } else { // Set default fields if it's not found in the list track.score = DEFAULT_SCORE.toFloat() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt index 88793b21cb..4502205d3a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt @@ -59,12 +59,12 @@ class BangumiApi(private val client: OkHttpClient, interceptor: BangumiIntercept .url("$apiUrl/collection/${track.media_id}/update") .post(sbody) .build() - return authClient.newCall(request) + return authClient.newCall(srequest) .asObservableSuccess() .map { track }.flatMap { - authClient.newCall(srequest) + authClient.newCall(request) .asObservableSuccess() .map { track