Skip to content

Commit

Permalink
Merge branch 'devel' into v19.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Nov 8, 2024
2 parents a8d78f9 + eaf3c07 commit 95e9102
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ This is a small bug fix release.
### Changelog

- 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

***
Expand Down
4 changes: 1 addition & 3 deletions src/mpd_client/playlists.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions src/mpd_worker/smartpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,18 @@ static bool mpd_worker_smartpls_update_sticker(struct t_mpd_worker_state *mpd_wo
unsigned i = 0;
struct t_list_node *current;
bool rc = true;
while (i < add_list->length) {
while (add_list->length > 0) {
if (mpd_command_list_begin(mpd_worker_state->partition_state->conn, false)) {
unsigned j = 0;
while ((current = list_shift_first(add_list)) != NULL) {
i++;
j++;
if (mpd_send_playlist_add(mpd_worker_state->partition_state->conn, playlist, current->key) == false) {
rc = mpd_send_playlist_add(mpd_worker_state->partition_state->conn, playlist, current->key);
list_node_free(current);
if (rc == false) {
mympd_set_mpd_failure(mpd_worker_state->partition_state, "Error adding command to command list mpd_send_playlist_add");
break;
}
list_node_free(current);
if (j == MPD_COMMANDS_MAX) {
break;
}
Expand Down

0 comments on commit 95e9102

Please sign in to comment.