From fa5f25e69bd491fa2d21df30c260bcd1795aab7a Mon Sep 17 00:00:00 2001 From: Yuriy Panov Date: Fri, 30 Oct 2026 12:45:01 +0600 Subject: [PATCH] fix: save My Wave settings as JSON settings3 now answers yamuse's form body with 415 unsupported-media-type, so every choice reverted to Any. Co-Authored-By: Claude Opus 5.5 --- crates/ym-api/src/client.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/ym-api/src/client.rs b/crates/ym-api/src/client.rs index 1f65527..7b20f2e 100644 --- a/crates/ym-api/src/client.rs +++ b/crates/ym-api/src/client.rs @@ -426,11 +426,16 @@ impl YmClient { .unwrap_or_default()) } + /// `settings3` takes JSON only: yamuse's form body gets `415 unsupported-media-type`. pub async fn set_wave_settings(&self, station: &str, settings: WaveSettings) -> Result<()> { let (mood, diversity, language) = settings.to_yamuse(); - self.inner - .rotor_set_station_settings(station, mood, diversity, language, yamuse::StationType::Rotor) - .await?; + let body = serde_json::json!({ + "moodEnergy": mood.as_str(), + "diversity": diversity.as_str(), + "language": language.as_str(), + "type": yamuse::StationType::Rotor.as_str(), + }); + self.post_json(&format!("/rotor/station/{station}/settings3"), &body).await?; Ok(()) }