mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Fix/Make descending R a pure R sort
https://forums.ankiweb.net/t/follow-up-make-descending-retrievability-a-pure-r-sort/67082
This commit is contained in:
parent
d24d2e3394
commit
da1ec192fe
2 changed files with 12 additions and 4 deletions
|
|
@ -836,9 +836,17 @@ impl fmt::Display for ReviewOrderSubclause {
|
|||
let today = timing.days_elapsed;
|
||||
let next_day_at = timing.next_day_at.0;
|
||||
let now = timing.now.0;
|
||||
temp_string =
|
||||
format!("extract_fsrs_relative_retrievability(data, case when odue !=0 then odue else due end, {today}, ivl, {next_day_at}, {now}) {order}");
|
||||
&temp_string
|
||||
if *order == SqlSortOrder::Ascending {
|
||||
// Use relative retrievability to give higher priority to high DR cards,
|
||||
// while selecting the most overdue ones first
|
||||
temp_string =
|
||||
format!("extract_fsrs_relative_retrievability(data, case when odue !=0 then odue else due end, {today}, ivl, {next_day_at}, {now}) asc");
|
||||
&temp_string
|
||||
} else {
|
||||
temp_string =
|
||||
format!("extract_fsrs_retrievability(data, case when odue !=0 then odue else due end, ivl, {today}, {next_day_at}, {now}) desc");
|
||||
&temp_string
|
||||
}
|
||||
}
|
||||
ReviewOrderSubclause::Added => "nid asc, ord asc",
|
||||
ReviewOrderSubclause::ReverseAdded => "nid desc, ord asc",
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ impl SqliteStorage {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum SqlSortOrder {
|
||||
Ascending,
|
||||
Descending,
|
||||
|
|
|
|||
Loading…
Reference in a new issue