cast info

This commit is contained in:
2026-01-14 18:42:16 +01:00
parent ed2e660d34
commit 83c9bcf12e
3 changed files with 33 additions and 12 deletions

View File

@@ -374,6 +374,9 @@ async fn cast_play(
sidecar_state: State<'_, SidecarState>,
device_name: String,
url: String,
title: Option<String>,
artist: Option<String>,
image: Option<String>,
) -> Result<(), String> {
// Resolve device name -> ip with diagnostics on failure
let ip = {
@@ -436,7 +439,15 @@ async fn cast_play(
let play_cmd = json!({
"command": "play",
"args": { "ip": ip, "url": url }
"args": {
"ip": ip,
"url": url,
"metadata": {
"title": title,
"artist": artist,
"image": image
}
}
});
let play_payload = format!("{}\n", play_cmd.to_string());
info!("Sending cast URL to device '{}': {}", device_name, url);