Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude new cards from Future Due stats #3576

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions rslib/src/stats/graphs/future_due.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ impl GraphsContext {
let mut due_by_day: HashMap<i32, u32> = Default::default();
let mut daily_load = 0.0;
for c in &self.cards {
if matches!(c.queue, CardQueue::New | CardQueue::Suspended) {
// matched on type because queue changes on burying or suspending a new card
if matches!(c.ctype, CardType::New) {
continue;
}
if matches!(c.queue, CardQueue::Suspended) {
continue;
}
let due = c.original_or_current_due();
Expand All @@ -27,9 +31,7 @@ impl GraphsContext {
due - (self.days_elapsed as i32)
};

if c.ctype != CardType::New {
daily_load += 1.0 / c.interval.max(1) as f32;
}
daily_load += 1.0 / c.interval.max(1) as f32;

// still want to filtered out buried cards that are due today
if due_day <= 0 && matches!(c.queue, CardQueue::UserBuried | CardQueue::SchedBuried) {
Expand Down