mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 07:35:57 -05:00
Merge pull request #200 from chme/mpdfixes
Some fixes for the mpd protocol support
This commit is contained in:
commit
b007529678
@ -3480,7 +3480,7 @@ mpd_command_decoders(struct evbuffer *evbuf, int argc, char **argv, char **errms
|
||||
evbuffer_add_printf(evbuf, "suffix: %s\n", ffmpeg_suffixes[i]);
|
||||
}
|
||||
|
||||
for (i = 0; ffmpeg_suffixes[i]; i++)
|
||||
for (i = 0; ffmpeg_mime_types[i]; i++)
|
||||
{
|
||||
evbuffer_add_printf(evbuf, "mime_type: %s\n", ffmpeg_mime_types[i]);
|
||||
}
|
||||
|
@ -3483,6 +3483,10 @@ playerqueue_remove_bypos(struct player_command *cmd)
|
||||
DPRINTF(E_DBG, L_PLAYER, "Removing item from position %d\n", pos);
|
||||
queue_remove_bypos(queue, ps_playing->item_id, pos, shuffle);
|
||||
|
||||
cur_plversion++;
|
||||
|
||||
listener_notify(LISTENER_PLAYLIST);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3501,6 +3505,10 @@ playerqueue_remove_byitemid(struct player_command *cmd)
|
||||
DPRINTF(E_DBG, L_PLAYER, "Removing item with id %d\n", id);
|
||||
queue_remove_byitemid(queue, id);
|
||||
|
||||
cur_plversion++;
|
||||
|
||||
listener_notify(LISTENER_PLAYLIST);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -787,10 +787,17 @@ queue_move_byitemid(struct queue *queue, unsigned int item_id, unsigned int to_p
|
||||
return;
|
||||
}
|
||||
|
||||
index = queue_index_byitemid(queue, item_id, shuffle);
|
||||
|
||||
if (index == to_pos)
|
||||
{
|
||||
DPRINTF(E_DBG, L_PLAYER, "Ignore moving item %d from index %d to %d\n", item_id, index, to_pos);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the index of the item to move is lower than the target index
|
||||
// If that is the case, increment the target position, because the given to_pos
|
||||
// is based on the queue without the moved item.
|
||||
index = queue_index_byitemid(queue, item_id, shuffle);
|
||||
if (index < to_pos)
|
||||
to_pos++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user