From 49c924415e98e78b2ea5a18e0d2777a571fb3ac9 Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 7 Feb 2025 11:23:57 +0100 Subject: Move db cards to specific function --- src/gui/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 3abe238..d721b90 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -47,15 +47,15 @@ pub fn start( let title = title( deck_name, - db::count_available(conn).unwrap_or(0), + db::cards::count_available(conn).unwrap_or(0), hide_remaining, ); - match db::pick_random_ready(conn) { + match db::cards::pick_random_ready(conn) { Some(card) => match question::ask(term, &title, &card)? { question::Response::Aborted => break, question::Response::Answered { difficulty } => { - db::update( + db::cards::update( conn, &card.question, &space_repetition::update(card.state, difficulty), @@ -63,7 +63,7 @@ pub fn start( } }, None => { - let message = match db::next_ready(conn) { + let message = match db::cards::next_ready(conn) { Some(ready) => { let now = time::seconds_since_unix_epoch()?; let duration = time::pp_duration(ready - now); -- cgit v1.2.3