From 0ec8def0d83650779267a0c97d873c41c9364468 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 7 Mar 2020 18:01:26 -0500 Subject: [PATCH] Avoid passing max chapter number from tracker (fixes #2131) --- .../tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt index 6c70bfe00..1a8c8ca48 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt @@ -56,6 +56,12 @@ class SetTrackChaptersDialog : DialogController val np: NumberPicker = view.findViewById(R.id.chapters_picker) // Set initial value np.value = item.track?.last_chapter_read ?: 0 + + // Enforce maximum value if tracker has total number of chapters set + if (item.track != null && item.track.total_chapters > 0) { + np.maxValue = item.track.total_chapters + } + // Don't allow to go from 0 to 9999 np.wrapSelectorWheel = false }