From 4f208c8ec516d83489166564008a76a7fb22c497 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Mon, 22 May 2023 21:19:14 +0100 Subject: [PATCH] added logs to db function --- src/animations.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/animations.rs b/src/animations.rs index 12f6058..18ce937 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -449,10 +449,15 @@ pub fn get_animation(name: &str, db: &State) -> Result })? .next(); + println!("got here 1"); + if next.is_none() { return Ok(None); } + + println!("got here 2"); + let mut animation = next.unwrap()?; struct KeyFrameId { @@ -463,6 +468,8 @@ pub fn get_animation(name: &str, db: &State) -> Result let mut stmt = conn.prepare("SELECT id, duration from keyframe where animation=?1 order by i asc")?; + println!("got here 3"); + let mut map = stmt.query_map([animation.id], |row| { Ok(KeyFrameId { id: row.get(0)?, @@ -473,6 +480,9 @@ pub fn get_animation(name: &str, db: &State) -> Result }) })?; + + println!("got here 4"); + while let Some(key_frame_id) = map.next() { let mut key_frame_id = key_frame_id?; @@ -494,9 +504,14 @@ pub fn get_animation(name: &str, db: &State) -> Result key_frame_id.keyframe.settings.push(light_setting?); } + println!("loop stuff"); + animation.animation.key_frames.push(key_frame_id.keyframe); } + + println!("got here 6"); + Ok(Some(animation.animation)) }