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 <noreply@anthropic.com>
This commit is contained in:
yuriy.pandClaude Opus 5.5 committed 2026-10-30 12:45:01 +06:00
1 parent 6dc8f0d9f2
commit fa5f25e69b
1 file changed
+8 -3
+8 -3
View File
@@ -426,11 +426,16 @@ impl YmClient {
.unwrap_or_default()) .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<()> { pub async fn set_wave_settings(&self, station: &str, settings: WaveSettings) -> Result<()> {
let (mood, diversity, language) = settings.to_yamuse(); let (mood, diversity, language) = settings.to_yamuse();
self.inner let body = serde_json::json!({
.rotor_set_station_settings(station, mood, diversity, language, yamuse::StationType::Rotor) "moodEnergy": mood.as_str(),
.await?; "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(()) Ok(())
} }