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)) }