diff --git a/.gitignore b/.gitignore index 0bef2d67..69c4c5f2 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ test_upnp*.cargo/ setup-env.sh cache gupnp-tools -pmocontrol_[0_9]*.txt \ No newline at end of file +pmocontrol_[0_9]*.txt +webapp_[0_9]*.txt \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index dddee6f7..41782122 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3263,6 +3263,7 @@ dependencies = [ "thiserror 2.0.17", "tokio", "tokio-stream", + "tokio-util", "tracing", "tracing-log 0.1.4", "tracing-subscriber", @@ -3492,6 +3493,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", + "tokio-util", "tracing", "tracing-subscriber", "utoipa", diff --git a/PMOMusic/src/main.rs b/PMOMusic/src/main.rs index 4463e41c..9db7cac2 100644 --- a/PMOMusic/src/main.rs +++ b/PMOMusic/src/main.rs @@ -122,7 +122,16 @@ async fn main() -> Result<(), Box> { info!("✅ PMOMusic is ready!"); info!("Press Ctrl+C to stop..."); + + // Attendre le signal Ctrl+C et l'arrêt du serveur HTTP server.write().await.wait().await; - Ok(()) + // Le serveur HTTP est arrêté, mais des threads (ControlPoint, etc.) peuvent encore tourner + // Attendre 2 secondes pour laisser le temps aux threads de se terminer + info!("Waiting for background threads to finish..."); + tokio::time::sleep(std::time::Duration::from_secs(2)).await; + + // Forcer l'arrêt du processus (les threads du ControlPoint tournent en boucle infinie) + info!("✅ PMOMusic stopped"); + std::process::exit(0); } diff --git a/pmoapp/webapp/.pmomusic_audio/cache.db b/pmoapp/webapp/.pmomusic_audio/cache.db deleted file mode 100644 index 6bb75df6..00000000 Binary files a/pmoapp/webapp/.pmomusic_audio/cache.db and /dev/null differ diff --git a/pmoapp/webapp/src/App.vue b/pmoapp/webapp/src/App.vue index e34a2665..882ae346 100644 --- a/pmoapp/webapp/src/App.vue +++ b/pmoapp/webapp/src/App.vue @@ -25,12 +25,16 @@
+ + + + + + + diff --git a/pmoapp/webapp/src/components/pmocontrol/ActionMenu.vue b/pmoapp/webapp/src/components/pmocontrol/ActionMenu.vue index 62e6d9ab..05c3560a 100644 --- a/pmoapp/webapp/src/components/pmocontrol/ActionMenu.vue +++ b/pmoapp/webapp/src/components/pmocontrol/ActionMenu.vue @@ -1,7 +1,7 @@