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
This commit is contained in:
Jarrett Ye 2024-10-28 12:10:10 +08:00 committed by GitHub
parent 8ebb274ff2
commit 0ce907fe5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {