Fix sorting by due column in notes mode

https://forums.ankiweb.net/t/anki-23-12-beta/37771/20
This commit is contained in:
Damien Elmes 2023-12-01 14:50:41 +10:00
parent dc3bd3efde
commit b29dc99b3e

View File

@ -422,7 +422,7 @@ fn prepare_sort(col: &mut Collection, column: Column, item_type: ReturnItemType)
Column::CardMod => include_str!("card_mod_order.sql"),
Column::Deck => include_str!("note_decks_order.sql"),
Column::Due => {
temp_string = format!("{} ORDER BY MIN({});", include_str!("note_due_order.sql"), format_args!("CASE WHEN due > 1000000000 OR c.type = {ctype} THEN due ELSE (due - {today}) * 86400 + {current_timestamp} END", ctype = CardType::New as i8, today = col.timing_today()?.days_elapsed, current_timestamp = TimestampSecs::now().0));
temp_string = format!("{} ORDER BY MIN({});", include_str!("note_due_order.sql"), format_args!("CASE WHEN due > 1000000000 OR type = {ctype} THEN due ELSE (due - {today}) * 86400 + {current_timestamp} END", ctype = CardType::New as i8, today = col.timing_today()?.days_elapsed, current_timestamp = TimestampSecs::now().0));
&temp_string
}
Column::Ease => include_str!("note_ease_order.sql"),