From 472211012b92f41b97293b869223801df65e8214 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 28 Jun 2026 15:32:57 +0200 Subject: [PATCH] feat: add web share target support and implement catalog search API This patch release bumps the version to 0.3.61 and introduces several key improvements across the stack. The backend `/info` route registration is deferred until after UPnP initialization to ensure the local server ID is correctly exposed. A new `GET /{id}/search` endpoint has been added to the pmosource API for querying music catalogs. On the frontend, Web Share Target support is enabled via Vite configuration and a dedicated composable that handles incoming URL parameters, playback state, and error notifications. Renderer selection state is also now exposed for UI synchronization. --- Cargo.lock | 2 +- PMOMusic/Cargo.toml | 2 +- PMOMusic/src/main.rs | 24 +++-- pmoapp/webapp/src/App.vue | 10 +++ pmoapp/webapp/src/composables/useRenderers.ts | 2 + .../webapp/src/composables/useShareTarget.ts | 90 +++++++++++++++++++ pmoapp/webapp/src/services/pmosource.ts | 12 +++ pmoapp/webapp/vite.config.ts | 9 ++ pmosource/src/api.rs | 83 +++++++++++++++++ version.txt | 2 +- 10 files changed, 225 insertions(+), 11 deletions(-) create mode 100644 pmoapp/webapp/src/composables/useShareTarget.ts diff --git a/Cargo.lock b/Cargo.lock index f949e768..5187a837 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "PMOMusic" -version = "0.3.59" +version = "0.3.61" dependencies = [ "axum 0.8.7", "console-subscriber", diff --git a/PMOMusic/Cargo.toml b/PMOMusic/Cargo.toml index 119c1e8f..f1dae798 100644 --- a/PMOMusic/Cargo.toml +++ b/PMOMusic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "PMOMusic" -version = "0.3.60" +version = "0.3.61" edition = "2024" [dependencies] diff --git a/PMOMusic/src/main.rs b/PMOMusic/src/main.rs index 1c6b1caa..80152871 100644 --- a/PMOMusic/src/main.rs +++ b/PMOMusic/src/main.rs @@ -15,14 +15,7 @@ async fn main() -> Result<(), Box> { // #[cfg(tokio_unstable)] // console_subscriber::init(); - let server = Server::create_upnp_server().await?; // Routes personnalisées de l'application - server - .write() - .await - .add_route("/info", || async { - serde_json::json!({"version": "1.0.0"}) - }) - .await; + let server = Server::create_upnp_server().await?; // Initialiser le système de gestion des sources musicales avec API REST info!("📡 Initializing music sources management system..."); @@ -91,6 +84,21 @@ async fn main() -> Result<(), Box> { // Initialiser les ProtocolInfo du MediaServer server_instance.init_protocol_info(); + let local_server_id = server_instance.udn().to_string(); + + // Exposer les informations de base de l'instance locale + { + let local_server_id_clone = local_server_id.clone(); + server + .write() + .await + .add_route("/info", move || { + let id = local_server_id_clone.clone(); + async move { serde_json::json!({"version": "1.0.0", "local_server_id": id}) } + }) + .await; + } + info!( "✅ MediaServer ready at {}{}", server_instance.base_url(), diff --git a/pmoapp/webapp/src/App.vue b/pmoapp/webapp/src/App.vue index 5da222ac..c1c736e1 100644 --- a/pmoapp/webapp/src/App.vue +++ b/pmoapp/webapp/src/App.vue @@ -10,7 +10,17 @@