started working
This commit is contained in:
parent
40a109637f
commit
8e615a31d1
@ -301,7 +301,7 @@ pub fn get_animation(name: &str, db: &State<DBPool>) -> Result<Option<Animation>
|
|||||||
struct AnimationId {
|
struct AnimationId {
|
||||||
animation: Animation,
|
animation: Animation,
|
||||||
id: u8
|
id: u8
|
||||||
};
|
}
|
||||||
|
|
||||||
let next = stmt.query_map([name], |row| {
|
let next = stmt.query_map([name], |row| {
|
||||||
Ok(AnimationId {
|
Ok(AnimationId {
|
||||||
@ -370,7 +370,7 @@ pub fn get_animation(name: &str, db: &State<DBPool>) -> Result<Option<Animation>
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#[get("/delete/<name>")]
|
#[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);
|
let animation = remove_animation(name, db);
|
||||||
|
|
||||||
|
@ -276,6 +276,9 @@ impl Render {
|
|||||||
to_clean.iter().for_each(|i| self.remove_animation(i.to_string()));
|
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()) {
|
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());
|
let err = self.ws.as_mut().unwrap().write(data.clone().into_iter());
|
||||||
|
|
||||||
if err.is_err() || err.ok().is_none() {
|
if err.is_err() || err.ok().is_none() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use rocket::{serde::{Deserialize, Serialize}, Responder, http::{ContentType, Header}};
|
use rocket::{serde::{Deserialize, Serialize}, Responder};
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
#[serde(crate="rocket::serde")]
|
#[serde(crate="rocket::serde")]
|
||||||
|
Loading…
Reference in New Issue
Block a user