started working

This commit is contained in:
Andre Henriques 2023-03-14 23:25:15 +00:00
parent 40a109637f
commit 8e615a31d1
3 changed files with 6 additions and 3 deletions

View File

@ -301,7 +301,7 @@ pub fn get_animation(name: &str, db: &State<DBPool>) -> Result<Option<Animation>
struct AnimationId {
animation: Animation,
id: u8
};
}
let next = stmt.query_map([name], |row| {
Ok(AnimationId {
@ -370,7 +370,7 @@ pub fn get_animation(name: &str, db: &State<DBPool>) -> Result<Option<Animation>
*
*/
#[get("/delete/<name>")]
pub async fn delete(name: &str, start_sender: &State<ASender<Animation>>, db: &State<DBPool>) -> String {
pub async fn delete(name: &str, db: &State<DBPool>) -> String {
let animation = remove_animation(name, db);

View File

@ -276,6 +276,9 @@ impl Render {
to_clean.iter().for_each(|i| self.remove_animation(i.to_string()));
if self.last.is_empty() || !self.last.clone().iter().eq(data.clone().iter()) {
let lerp_data = data.iter().zip(self.last).map(|(d, l)| d - ((l - d) * 0.2));
let err = self.ws.as_mut().unwrap().write(data.clone().into_iter());
if err.is_err() || err.ok().is_none() {

View File

@ -1,4 +1,4 @@
use rocket::{serde::{Deserialize, Serialize}, Responder, http::{ContentType, Header}};
use rocket::{serde::{Deserialize, Serialize}, Responder};
#[derive(Deserialize, Serialize)]
#[serde(crate="rocket::serde")]