|
|
|
@ -41,9 +41,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
|
.await?;
|
|
|
|
|
sqlx::migrate!("./migrations").run(&pool).await?;
|
|
|
|
|
|
|
|
|
|
for f in files {
|
|
|
|
|
println!("Launching {}", f.path().display());
|
|
|
|
|
}
|
|
|
|
|
launch_mpv().await?;
|
|
|
|
|
|
|
|
|
|
// 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 end_file_listener = mpvctl.listen(&["end-file"])?;
|
|
|
|
|
let client_name = mpvctl.get_client_name().await?;
|
|
|
|
|
let _ = mpvctl
|
|
|
|
|
.play_video("/home/talexander/Downloads/test.mp4")
|
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
while let Some(evt) = end_file_listener.recv().await {
|
|
|
|
|
println!("end file event {}", evt);
|
|
|
|
|
for f in files {
|
|
|
|
|
println!("Launching {}", f.path().display());
|
|
|
|
|
mpvctl.play_video(f.path()).await?;
|
|
|
|
|
if let Some(evt) = end_file_listener.recv().await {
|
|
|
|
|
println!("end file event {}", evt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sleep(Duration::from_secs(50)).await;
|
|
|
|
|
let client_name = mpvctl.get_client_name().await?;
|
|
|
|
|
|
|
|
|
|
println!("done {}", client_name);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|