Properly playing the files in the list instead of hard-coded paths.
This commit is contained in:
parent
860f5759c1
commit
6eeee7ef04
18
src/main.rs
18
src/main.rs
@ -41,9 +41,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
.await?;
|
.await?;
|
||||||
sqlx::migrate!("./migrations").run(&pool).await?;
|
sqlx::migrate!("./migrations").run(&pool).await?;
|
||||||
|
|
||||||
for f in files {
|
|
||||||
println!("Launching {}", f.path().display());
|
|
||||||
}
|
|
||||||
launch_mpv().await?;
|
launch_mpv().await?;
|
||||||
|
|
||||||
// TODO: Figure out a better way to wait for the socket to exist and be connectable
|
// TODO: Figure out a better way to wait for the socket to exist and be connectable
|
||||||
@ -52,17 +49,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let mut mpvctl = MpvCtl::connect("/tmp/recordwatchsocket").await?;
|
let mut mpvctl = MpvCtl::connect("/tmp/recordwatchsocket").await?;
|
||||||
let mut end_file_listener = mpvctl.listen(&["end-file"])?;
|
let mut end_file_listener = mpvctl.listen(&["end-file"])?;
|
||||||
let client_name = mpvctl.get_client_name().await?;
|
let client_name = mpvctl.get_client_name().await?;
|
||||||
let _ = mpvctl
|
for f in files {
|
||||||
.play_video("/home/talexander/Downloads/test.mp4")
|
println!("Launching {}", f.path().display());
|
||||||
.await?;
|
mpvctl.play_video(f.path()).await?;
|
||||||
|
if let Some(evt) = end_file_listener.recv().await {
|
||||||
while let Some(evt) = end_file_listener.recv().await {
|
println!("end file event {}", evt);
|
||||||
println!("end file event {}", evt);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(Duration::from_secs(50)).await;
|
|
||||||
let client_name = mpvctl.get_client_name().await?;
|
|
||||||
|
|
||||||
println!("done {}", client_name);
|
println!("done {}", client_name);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user