diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index af5dde895..21d2c79ed 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -176,9 +176,11 @@ class Scheduler: # current deck points to a missing deck self.newCount = 0 self.revCount = 0 + self._immediate_learn_count = 0 else: self.newCount = node.new_count self.revCount = node.review_count + self._immediate_learn_count = node.learn_count def counts(self, card: Optional[Card] = None) -> Tuple[int, int, int]: counts = [self.newCount, self.lrnCount, self.revCount] @@ -188,6 +190,10 @@ class Scheduler: new, lrn, rev = counts return (new, lrn, rev) + def _is_finished(self): + "Don't use this, it is a stop-gap until this code is refactored." + return not any((self.newCount, self.revCount, self._immediate_learn_count)) + def dueForecast(self, days: int = 7) -> List[Any]: "Return counts over next DAYS. Includes today." daysd: Dict[int, int] = dict( diff --git a/qt/aqt/overview.py b/qt/aqt/overview.py index 08a514862..52c3ad52b 100644 --- a/qt/aqt/overview.py +++ b/qt/aqt/overview.py @@ -158,11 +158,10 @@ class Overview: shareLink = 'Reviews and Updates' else: shareLink = "" - table_text = self._table() - if not table_text: - # deck is finished + if self.mw.col.sched._is_finished(): self._show_finished_screen() return + table_text = self._table() content = OverviewContent( deck=deck["name"], shareLink=shareLink, @@ -196,14 +195,9 @@ class Overview: return '
| %s |