don't ignore buried cards in future due graph (#3368)

it does ignore them for the current day but not days in the future
This commit is contained in:
Jake Probst 2024-08-22 02:53:41 -07:00 committed by GitHub
parent a6d5c94997
commit 7ea573b004
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<i32, u32> = 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;
}