diff --git a/proto/anki/collection.proto b/proto/anki/collection.proto index f0db48709..c08c36e27 100644 --- a/proto/anki/collection.proto +++ b/proto/anki/collection.proto @@ -138,7 +138,7 @@ message ComputeWeightsProgress { uint32 current = 1; // Total iterations uint32 total = 2; - uint32 fsrs_items = 3; + uint32 reviews = 3; // Only used in 'compute all weights' case uint32 current_preset = 4; // Only used in 'compute all weights' case diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 80fbd7ca1..f4aa121d0 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -445,7 +445,7 @@ def update_deck_configs() -> bytes: update.label = ( label + "\n" - + tr.deck_config_percent_of_reviews(pct=pct, reviews=val2.fsrs_items) + + tr.deck_config_percent_of_reviews(pct=pct, reviews=val2.reviews) ) else: return diff --git a/rslib/src/progress.rs b/rslib/src/progress.rs index 8982dcdb8..c1412251f 100644 --- a/rslib/src/progress.rs +++ b/rslib/src/progress.rs @@ -213,7 +213,7 @@ pub(crate) fn progress_to_proto( Value::ComputeWeights(anki_proto::collection::ComputeWeightsProgress { current: progress.current_iteration, total: progress.total_iterations, - fsrs_items: progress.fsrs_items, + reviews: progress.reviews, current_preset: progress.current_preset, total_presets: progress.total_presets, }) diff --git a/rslib/src/scheduler/fsrs/weights.rs b/rslib/src/scheduler/fsrs/weights.rs index 7285611f6..7dec287c3 100644 --- a/rslib/src/scheduler/fsrs/weights.rs +++ b/rslib/src/scheduler/fsrs/weights.rs @@ -70,7 +70,6 @@ impl Collection { } let fsrs_items = items.len() as u32; anki_progress.update(false, |p| { - p.fsrs_items = fsrs_items; p.current_preset = current_preset; p.total_presets = total_presets; })?; @@ -85,6 +84,7 @@ impl Collection { if let Err(_err) = anki_progress.update(false, |s| { s.total_iterations = guard.total() as u32; s.current_iteration = guard.current() as u32; + s.reviews = review_count as u32; finished = guard.finished(); }) { guard.want_abort = true; @@ -157,7 +157,6 @@ impl Collection { .col .storage .get_revlog_entries_for_searched_cards_in_card_order()?; - anki_progress.state.fsrs_items = revlogs.len() as u32; let (items, review_count) = fsrs_items_for_training(revlogs, timing.next_day_at, ignore_revlogs_before); if review_count < 400 { @@ -165,6 +164,7 @@ impl Collection { count: review_count, }); } + anki_progress.state.reviews = review_count as u32; let fsrs = FSRS::new(Some(weights))?; Ok(fsrs.evaluate(items, |ip| { anki_progress @@ -181,7 +181,7 @@ impl Collection { pub struct ComputeWeightsProgress { pub current_iteration: u32, pub total_iterations: u32, - pub fsrs_items: u32, + pub reviews: u32, /// Only used in 'compute all weights' case pub current_preset: u32, /// Only used in 'compute all weights' case diff --git a/ts/deck-options/FsrsOptions.svelte b/ts/deck-options/FsrsOptions.svelte index f9b857111..9c076362d 100644 --- a/ts/deck-options/FsrsOptions.svelte +++ b/ts/deck-options/FsrsOptions.svelte @@ -229,7 +229,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html if (val instanceof ComputeRetentionProgress) { return `${pct}%`; } else { - return tr.deckConfigPercentOfReviews({ pct, reviews: val.fsrsItems }); + return tr.deckConfigPercentOfReviews({ pct, reviews: val.reviews }); } }