Fix bug where status cannot be updated when all chapters have been read. (#2683)

Minor cleanup.
This commit is contained in:
MCAxiaz
2020-03-09 08:32:59 -07:00
committed by GitHub
parent fb00929ee9
commit 07e2bdac81
7 changed files with 41 additions and 40 deletions

View File

@@ -115,6 +115,9 @@ class TrackPresenter(
fun setStatus(item: TrackItem, index: Int) {
val track = item.track!!
track.status = item.service.getStatusList()[index]
if (track.status == item.service.getCompletionStatus() && track.total_chapters != 0) {
track.last_chapter_read = track.total_chapters
}
updateRemote(track, item.service)
}
@@ -127,6 +130,9 @@ class TrackPresenter(
fun setLastChapterRead(item: TrackItem, chapterNumber: Int) {
val track = item.track!!
track.last_chapter_read = chapterNumber
if (track.total_chapters != 0 && track.last_chapter_read == track.total_chapters) {
track.status = item.service.getCompletionStatus()
}
updateRemote(track, item.service)
}
}