squash some bugs

This commit is contained in:
CptCaptain 2020-09-08 20:55:38 +02:00
parent e8765c4b32
commit f572b19942

View File

@ -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("/")
}