mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
[player] Allow removing by position (dacp-requests) if player is stopped
This commit is contained in:
parent
ed2fe682fe
commit
e3750957f5
@ -3488,6 +3488,7 @@ playerqueue_remove_bypos(struct player_command *cmd)
|
|||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
struct player_source *ps_playing;
|
struct player_source *ps_playing;
|
||||||
|
uint32_t item_id;
|
||||||
|
|
||||||
pos = cmd->arg.intval;
|
pos = cmd->arg.intval;
|
||||||
if (pos < 1)
|
if (pos < 1)
|
||||||
@ -3500,12 +3501,14 @@ playerqueue_remove_bypos(struct player_command *cmd)
|
|||||||
|
|
||||||
if (!ps_playing)
|
if (!ps_playing)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_PLAYER, "Can't remove item at pos %d, no playing item found\n", pos);
|
DPRINTF(E_DBG, L_PLAYER, "No playing item for remove by pos\n");
|
||||||
return -1;
|
item_id = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
item_id = ps_playing->item_id;
|
||||||
|
|
||||||
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, item_id, pos, shuffle);
|
||||||
|
|
||||||
cur_plversion++;
|
cur_plversion++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user