This commit is contained in:
Alexander Heldt
2025-11-16 15:35:51 +01:00
parent 2dee0247dc
commit c3df22ecd8
4 changed files with 98 additions and 20 deletions

View File

@@ -0,0 +1,23 @@
// fn parse_playback_time(
// json_string: String,
// ) -> Result(PlaybackTime, ControlError) {
// let decoder = {
// let float_dececoder = fn(data_string) {
// case float.parse(data_string) {
// Error(_) -> decode.failure(0.0, "data")
// Ok(float_value) -> decode.success(float_value)
// }
// }
// use data <- decode.field(
// "data",
// decode.then(decode.string, float_dececoder),
// )
// decode.success(PlaybackTime(data))
// }
// result.map_error(
// json.parse(from: string.trim(json_string), using: decoder),
// fn(r) { ControlError(string.inspect(r)) },
// )
// }