[player] Allow moving by position (dacp-requests) if player is stopped
This commit is contained in:
parent
cb919515e4
commit
ed2fe682fe
|
@ -3429,6 +3429,7 @@ static int
|
||||||
playerqueue_move_bypos(struct player_command *cmd)
|
playerqueue_move_bypos(struct player_command *cmd)
|
||||||
{
|
{
|
||||||
struct player_source *ps_playing;
|
struct player_source *ps_playing;
|
||||||
|
uint32_t item_id;
|
||||||
|
|
||||||
DPRINTF(E_DBG, L_PLAYER, "Moving song from position %d to be the next song after %d\n",
|
DPRINTF(E_DBG, L_PLAYER, "Moving song from position %d to be the next song after %d\n",
|
||||||
cmd->arg.queue_move_param.from_pos, cmd->arg.queue_move_param.to_pos);
|
cmd->arg.queue_move_param.from_pos, cmd->arg.queue_move_param.to_pos);
|
||||||
|
@ -3437,11 +3438,13 @@ playerqueue_move_bypos(struct player_command *cmd)
|
||||||
|
|
||||||
if (!ps_playing)
|
if (!ps_playing)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_PLAYER, "Can't move item, no playing item found\n");
|
DPRINTF(E_DBG, L_PLAYER, "No playing item found for move by pos\n");
|
||||||
return -1;
|
item_id = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
item_id = ps_playing->item_id;
|
||||||
|
|
||||||
queue_move_bypos(queue, ps_playing->item_id, cmd->arg.queue_move_param.from_pos, cmd->arg.queue_move_param.to_pos, shuffle);
|
queue_move_bypos(queue, item_id, cmd->arg.queue_move_param.from_pos, cmd->arg.queue_move_param.to_pos, shuffle);
|
||||||
|
|
||||||
cur_plversion++;
|
cur_plversion++;
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@ queueitem_get_bypos(struct queue *queue, unsigned int item_id, unsigned int pos,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (item = item_base; item != queue->head && i < pos; item = item_next(item, shuffle))
|
for (item = item_base; i < pos; item = item_next(item, shuffle))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue