From b29dc99b3ee145620316a60fc0f26c1716154498 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 1 Dec 2023 14:50:41 +1000 Subject: [PATCH] Fix sorting by due column in notes mode https://forums.ankiweb.net/t/anki-23-12-beta/37771/20 --- rslib/src/search/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/search/mod.rs b/rslib/src/search/mod.rs index aa245b391..5d26392a4 100644 --- a/rslib/src/search/mod.rs +++ b/rslib/src/search/mod.rs @@ -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"),