mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[queue] Ignore moving an item to its current position (would results in
an invalid queue)
This commit is contained in:
parent
8fc8d08b42
commit
6d720dec94
@ -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