From eaf3c073529785b2b2315df909d8ccbc20fe1082 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Thu, 7 Nov 2024 22:10:21 +0100 Subject: [PATCH] Fix: Do not crop playlists on shuffle #1369 --- CHANGELOG.md | 1 + src/mpd_client/playlists.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5b9528a1..c7e5b9542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This is a small bug fix release. - Upd: Translations - Fix: Add correct number of songs to sticker based smart playlist #1369 +- Fix: Do not crop playlists on shuffle #1369 - Fix: Remove duplicate depends in Debian Control file *** diff --git a/src/mpd_client/playlists.c b/src/mpd_client/playlists.c index e79b9a1ff..6a71956d9 100644 --- a/src/mpd_client/playlists.c +++ b/src/mpd_client/playlists.c @@ -274,14 +274,12 @@ bool mpd_client_playlist_shuffle(struct t_partition_state *partition_state, cons //add shuffled songs to tmp playlist //uses command list to add MPD_COMMANDS_MAX songs at once - unsigned i = 0; bool rc = true; - while (i < plist.length) { + while (plist.length > 0) { if (mpd_command_list_begin(partition_state->conn, false) == true) { unsigned j = 0; struct t_list_node *current; while ((current = list_shift_first(&plist)) != NULL) { - i++; j++; rc = mpd_send_playlist_add(partition_state->conn, playlist_tmp, current->key); list_node_free(current);