From 0ce907fe5b2310cdb150f0ff44bd245633ec6038 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Mon, 28 Oct 2024 12:10:10 +0800 Subject: [PATCH] Fix/buried new cards shouldn't be counted in daily load (#3530) * Fix/buried new cards shouldn't be counted in daily load * exclude new cards by its type * ./ninja format --- rslib/src/stats/graphs/future_due.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rslib/src/stats/graphs/future_due.rs b/rslib/src/stats/graphs/future_due.rs index 3c0194a38..a98f2de5c 100644 --- a/rslib/src/stats/graphs/future_due.rs +++ b/rslib/src/stats/graphs/future_due.rs @@ -7,6 +7,7 @@ use anki_proto::stats::graphs_response::FutureDue; use super::GraphsContext; use crate::card::CardQueue; +use crate::card::CardType; use crate::scheduler::timing::is_unix_epoch_timestamp; impl GraphsContext { @@ -26,7 +27,9 @@ impl GraphsContext { due - (self.days_elapsed as i32) }; - daily_load += 1.0 / c.interval.max(1) as f32; + if c.ctype != CardType::New { + 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) {