squash some bugs

master
CptCaptain 4 years ago
parent e8765c4b32
commit f572b19942
  1. 5
      src/main.rs

@ -15,7 +15,10 @@ struct Video {
#[post("/new", data = "<video>")]
fn new(video: Form<Video>) -> Redirect {
if video.link.starts_with("https://"){
Command::new("/bin/env").args(&["bash", "-c", &format!("mpv {link}", link=&video.link).to_string()]).output().expect("Failed to execute command");
Command::new("/bin/env")
.args(&["DISPLAY:=0", "bash", "-c", &format!("mpv {link}", link=&video.link).to_string()])
.output()
.expect("Failed to execute command");
}
Redirect::to("/")
}

Loading…
Cancel
Save