Merge pull request #200 from chme/mpdfixes

Some fixes for the mpd protocol support
This commit is contained in:
ejurgensen 2015-11-22 11:40:53 +01:00
commit b007529678
3 changed files with 17 additions and 2 deletions

View File

@ -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]); 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]); evbuffer_add_printf(evbuf, "mime_type: %s\n", ffmpeg_mime_types[i]);
} }

View File

@ -3483,6 +3483,10 @@ playerqueue_remove_bypos(struct player_command *cmd)
DPRINTF(E_DBG, L_PLAYER, "Removing item from position %d\n", pos); DPRINTF(E_DBG, L_PLAYER, "Removing item from position %d\n", pos);
queue_remove_bypos(queue, ps_playing->item_id, pos, shuffle); queue_remove_bypos(queue, ps_playing->item_id, pos, shuffle);
cur_plversion++;
listener_notify(LISTENER_PLAYLIST);
return 0; 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); DPRINTF(E_DBG, L_PLAYER, "Removing item with id %d\n", id);
queue_remove_byitemid(queue, id); queue_remove_byitemid(queue, id);
cur_plversion++;
listener_notify(LISTENER_PLAYLIST);
return 0; return 0;
} }

View File

@ -787,10 +787,17 @@ queue_move_byitemid(struct queue *queue, unsigned int item_id, unsigned int to_p
return; 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 // 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 // If that is the case, increment the target position, because the given to_pos
// is based on the queue without the moved item. // is based on the queue without the moved item.
index = queue_index_byitemid(queue, item_id, shuffle);
if (index < to_pos) if (index < to_pos)
to_pos++; to_pos++;