-module(rockbox@system). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/rockbox/system.gleam"). -export([version/1, status/1]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC(" Daemon information — version string and global runtime status.\n"). -file("src/rockbox/system.gleam", 9). -spec version(rockbox:client()) -> {ok, binary()} | {error, rockbox@error:error()}. version(Client) -> Decoder = begin gleam@dynamic@decode:field( <<"rockboxVersion"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(V) -> gleam@dynamic@decode:success(V) end ) end, rockbox:'query'( Client, <<"query Version { rockboxVersion }"/utf8>>, gleam@json:object([]), Decoder ). -file("src/rockbox/system.gleam", 22). -spec status(rockbox:client()) -> {ok, rockbox@types:system_status()} | {error, rockbox@error:error()}. status(Client) -> Decoder = begin gleam@dynamic@decode:field( <<"globalStatus"/utf8>>, rockbox@types:system_status_decoder(), fun(Status) -> gleam@dynamic@decode:success(Status) end ) end, rockbox:'query'( Client, <<"query GlobalStatus { globalStatus { resumeIndex resumeCrc32 resumeElapsed resumeOffset runtime topruntime dircacheSize lastScreen viewerIconCount lastVolumeChange } }"/utf8>>, gleam@json:object([]), Decoder ).