Allow extracting desired retention
This commit is contained in:
parent
2126ff9a16
commit
06d99b5871
@ -235,7 +235,7 @@ fn add_extract_custom_data_function(db: &Connection) -> rusqlite::Result<()> {
|
||||
)
|
||||
}
|
||||
|
||||
/// eg. extract_fsrs_variable(card.data, 's' | 'd') -> float | null
|
||||
/// eg. extract_fsrs_variable(card.data, 's' | 'd' | 'dr') -> float | null
|
||||
fn add_extract_fsrs_variable(db: &Connection) -> rusqlite::Result<()> {
|
||||
db.create_scalar_function(
|
||||
"extract_fsrs_variable",
|
||||
@ -257,6 +257,7 @@ fn add_extract_fsrs_variable(db: &Connection) -> rusqlite::Result<()> {
|
||||
Ok(match key {
|
||||
"s" => card_data.fsrs_stability,
|
||||
"d" => card_data.fsrs_difficulty,
|
||||
"dr" => card_data.fsrs_desired_retention,
|
||||
_ => panic!("invalid key: {key}"),
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user