瀏覽代碼

Avoid passing max chapter number from tracker (fixes #2131)

arkon 5 年之前
父節點
當前提交
0ec8def0d8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt

+ 6 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/SetTrackChaptersDialog.kt

@@ -56,6 +56,12 @@ class SetTrackChaptersDialog<T> : 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
         }