Save My Wave settings as JSON
settings3 now answers a 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
d65db50bd6
commit
5597c4c235
1 file changed
+8
-8
@@ -239,15 +239,15 @@ class YmClient private constructor(
|
||||
return WaveSettings.from(first["settings2"] ?: first["settings"])
|
||||
}
|
||||
|
||||
/** `settings3` takes JSON only: a form body gets `415 unsupported-media-type`. */
|
||||
suspend fun setWaveSettings(station: String, settings: WaveSettings) {
|
||||
val result = http.postForm(
|
||||
"/rotor/station/$station/settings3",
|
||||
Params()
|
||||
.add("moodEnergy", settings.mood.api ?: "all")
|
||||
.add("diversity", settings.character.api ?: "default")
|
||||
.add("type", "rotor")
|
||||
.add("language", settings.language.api ?: "any"),
|
||||
)
|
||||
val body = buildJsonObject {
|
||||
put("moodEnergy", settings.mood.api ?: "all")
|
||||
put("diversity", settings.character.api ?: "default")
|
||||
put("language", settings.language.api ?: "any")
|
||||
put("type", "rotor")
|
||||
}
|
||||
val result = http.postJson("/rotor/station/$station/settings3", body)
|
||||
requireAck(result, "station settings")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user