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:
1 parent
6dc8f0d9f2
commit
fa5f25e69b
1 file changed
+8
-3
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user