squash some bugs
This commit is contained in:
parent
e8765c4b32
commit
f572b19942
@ -15,7 +15,10 @@ struct Video {
|
|||||||
#[post("/new", data = "<video>")]
|
#[post("/new", data = "<video>")]
|
||||||
fn new(video: Form<Video>) -> Redirect {
|
fn new(video: Form<Video>) -> Redirect {
|
||||||
if video.link.starts_with("https://"){
|
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("/")
|
Redirect::to("/")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user