Commit 9cc37bde authored by Max Kellermann's avatar Max Kellermann

command/PlayerCommands: emit "volume" only if it is known

The "-1" magic value is deprecated now.
parent 3f754fd3
......@@ -127,8 +127,12 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
}
const playlist &playlist = client.GetPlaylist();
r.Format("volume: %i\n"
COMMAND_STATUS_REPEAT ": %i\n"
const auto volume = volume_level_get(client.GetPartition().outputs);
if (volume >= 0)
r.Format("volume: %i\n", volume);
r.Format(COMMAND_STATUS_REPEAT ": %i\n"
COMMAND_STATUS_RANDOM ": %i\n"
COMMAND_STATUS_SINGLE ": %i\n"
COMMAND_STATUS_CONSUME ": %i\n"
......@@ -136,7 +140,6 @@ handle_status(Client &client, gcc_unused Request args, Response &r)
COMMAND_STATUS_PLAYLIST_LENGTH ": %i\n"
COMMAND_STATUS_MIXRAMPDB ": %f\n"
COMMAND_STATUS_STATE ": %s\n",
volume_level_get(client.GetPartition().outputs),
playlist.GetRepeat(),
playlist.GetRandom(),
playlist.GetSingle(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment