return # no change
queue.shuffle_enabled = shuffle_enabled
queue_items = self._queue_items[queue_id]
- cur_index = queue.index_in_buffer or queue.current_index
+ cur_index = (
+ queue.index_in_buffer if queue.index_in_buffer is not None else queue.current_index
+ )
if cur_index is not None:
next_index = cur_index + 1
next_items = queue_items[next_index:]
# load the items into the queue
if queue.state in (PlaybackState.PLAYING, PlaybackState.PAUSED):
- cur_index = queue.index_in_buffer or queue.current_index or 0
+ cur_index = (
+ queue.index_in_buffer
+ if queue.index_in_buffer is not None
+ else (queue.current_index if queue.current_index is not None else 0)
+ )
else:
cur_index = queue.current_index or 0
insert_at_index = cur_index + 1