From 7ea573b004c976d20d95d706893993c1b6d79f74 Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Thu, 22 Aug 2024 02:53:41 -0700 Subject: [PATCH] don't ignore buried cards in future due graph (#3368) it does ignore them for the current day but not days in the future --- rslib/src/stats/graphs/future_due.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rslib/src/stats/graphs/future_due.rs b/rslib/src/stats/graphs/future_due.rs index ef7da2ad3..4671766e5 100644 --- a/rslib/src/stats/graphs/future_due.rs +++ b/rslib/src/stats/graphs/future_due.rs @@ -6,6 +6,7 @@ use std::collections::HashMap; use anki_proto::stats::graphs_response::FutureDue; use super::GraphsContext; +use crate::card::CardQueue; use crate::scheduler::timing::is_unix_epoch_timestamp; impl GraphsContext { @@ -13,7 +14,7 @@ impl GraphsContext { let mut have_backlog = false; let mut due_by_day: HashMap = Default::default(); for c in &self.cards { - if c.queue as i8 <= 0 { + if matches!(c.queue, CardQueue::New | CardQueue::Suspended) { continue; } let due = c.original_or_current_due(); @@ -24,6 +25,10 @@ impl GraphsContext { due - (self.days_elapsed as i32) }; + // still want to filtered out buried cards that are due today + if due_day == 0 && matches!(c.queue, CardQueue::UserBuried | CardQueue::SchedBuried) { + continue; + } have_backlog |= due_day < 0; *due_by_day.entry(due_day).or_default() += 1; }