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

playlist: recalculate the queued song after random is toggled

When the random mode is toggled, MPD did not clear the queue. Because of this, MPD continued with the next (random or non-random) song according to the previous mode. Clear the queued song to fix that.
parent 144a91ca
...@@ -28,6 +28,7 @@ ver 0.15 - (200?/??/??) ...@@ -28,6 +28,7 @@ ver 0.15 - (200?/??/??)
* failure to read the state file is non-fatal * failure to read the state file is non-fatal
* --create-db starts the MPD daemon instead of exiting * --create-db starts the MPD daemon instead of exiting
* playlist_directory and music_directory are optional * playlist_directory and music_directory are optional
* playlist: recalculate the queued song after random is toggled
ver 0.14.1 (2009/01/17) ver 0.14.1 (2009/01/17)
......
...@@ -951,6 +951,9 @@ void setPlaylistRandomStatus(bool status) ...@@ -951,6 +951,9 @@ void setPlaylistRandomStatus(bool status)
if (status == playlist.queue.random) if (status == playlist.queue.random)
return; return;
if (playlist.queued >= 0)
clearPlayerQueue();
playlist.queue.random = status; playlist.queue.random = status;
if (playlist.queue.random) { if (playlist.queue.random) {
......
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