From e23f4eef64ec85bc50676844898d8f8d83b61c16 Mon Sep 17 00:00:00 2001 From: sorata <136738526+brishtibheja@users.noreply.github.com> Date: Tue, 24 Dec 2024 18:39:45 +0530 Subject: [PATCH 1/2] Revert "Fix/skip suspended cards in graphs context retrievability (#3518)" This reverts commit 939cc5a268108eb518ebfeff3c9a21b3bb57be8b. --- rslib/src/browser_table.rs | 10 +++++----- rslib/src/stats/graphs/retrievability.rs | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/rslib/src/browser_table.rs b/rslib/src/browser_table.rs index 4680caa0dc..eb811f5e2b 100644 --- a/rslib/src/browser_table.rs +++ b/rslib/src/browser_table.rs @@ -115,8 +115,8 @@ impl Card { } else if self.is_due_in_days() { Some( TimestampSecs::now().adding_secs( - (self.original_or_current_due() as i64 - timing.days_elapsed as i64) - .saturating_mul(86400), + ((self.original_or_current_due() - timing.days_elapsed as i32) + .saturating_mul(86400)) as i64, ), ) } else { @@ -134,9 +134,9 @@ impl Card { ) } else { self.due_time(timing).map(|due| { - (due.adding_secs(-86_400 * self.interval as i64) - .elapsed_secs() - / 86_400) as u32 + due.adding_secs(-86_400 * self.interval as i64) + .elapsed_secs() as u32 + / 86_400 }) } } diff --git a/rslib/src/stats/graphs/retrievability.rs b/rslib/src/stats/graphs/retrievability.rs index 2c47830e34..930a21c5b0 100644 --- a/rslib/src/stats/graphs/retrievability.rs +++ b/rslib/src/stats/graphs/retrievability.rs @@ -4,7 +4,6 @@ use anki_proto::stats::graphs_response::Retrievability; use fsrs::FSRS; -use crate::card::CardQueue; use crate::scheduler::timing::SchedTimingToday; use crate::stats::graphs::eases::percent_to_bin; use crate::stats::graphs::GraphsContext; @@ -24,9 +23,6 @@ impl GraphsContext { let mut note_retrievability: std::collections::HashMap = std::collections::HashMap::new(); for card in &self.cards { - if card.queue == CardQueue::Suspended { - continue; - } let entry = note_retrievability .entry(card.note_id.0) .or_insert((0.0, 0)); From 2507c0eb298f6c024f31433a07b4f668d413f3a0 Mon Sep 17 00:00:00 2001 From: sorata <136738526+brishtibheja@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:07:21 +0530 Subject: [PATCH 2/2] apply suggestions --- rslib/src/browser_table.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rslib/src/browser_table.rs b/rslib/src/browser_table.rs index eb811f5e2b..4680caa0dc 100644 --- a/rslib/src/browser_table.rs +++ b/rslib/src/browser_table.rs @@ -115,8 +115,8 @@ impl Card { } else if self.is_due_in_days() { Some( TimestampSecs::now().adding_secs( - ((self.original_or_current_due() - timing.days_elapsed as i32) - .saturating_mul(86400)) as i64, + (self.original_or_current_due() as i64 - timing.days_elapsed as i64) + .saturating_mul(86400), ), ) } else { @@ -134,9 +134,9 @@ impl Card { ) } else { self.due_time(timing).map(|due| { - due.adding_secs(-86_400 * self.interval as i64) - .elapsed_secs() as u32 - / 86_400 + (due.adding_secs(-86_400 * self.interval as i64) + .elapsed_secs() + / 86_400) as u32 }) } }