diff --git a/rslib/src/scheduler/fsrs/params.rs b/rslib/src/scheduler/fsrs/params.rs index 1bedf4ffc..d31e2aa86 100644 --- a/rslib/src/scheduler/fsrs/params.rs +++ b/rslib/src/scheduler/fsrs/params.rs @@ -129,7 +129,7 @@ impl Collection { /// Used for exporting revlogs for algorithm research. pub fn export_dataset(&mut self, min_entries: usize, target_path: &Path) -> Result<()> { - let revlog_entries = self.storage.get_all_revlog_entries_in_card_order()?; + let revlog_entries = self.storage.get_revlog_entries_for_export_dataset()?; if revlog_entries.len() < min_entries { return Err(AnkiError::FsrsInsufficientData); } diff --git a/rslib/src/storage/revlog/mod.rs b/rslib/src/storage/revlog/mod.rs index 84332b0d0..c6ff49271 100644 --- a/rslib/src/storage/revlog/mod.rs +++ b/rslib/src/storage/revlog/mod.rs @@ -154,6 +154,17 @@ impl SqliteStorage { .collect() } + pub(crate) fn get_revlog_entries_for_export_dataset(&self) -> Result> { + self.db + .prepare_cached(concat!( + include_str!("get.sql"), + " where ease between 1 and 4", + " order by cid, id" + ))? + .query_and_then([], row_to_revlog_entry)? + .collect() + } + pub(crate) fn get_all_revlog_entries_in_card_order(&self) -> Result> { self.db .prepare_cached(concat!(include_str!("get.sql"), " order by cid, id"))?