libsaria: Fix queue num_visible()
When songs are removed from the queue, they should also be removed from the visible set, otherwise num_visible() will never change.
This commit is contained in:
parent
c9dee00727
commit
884c55cdd5
|
@ -6,9 +6,15 @@ import queue
|
|||
|
||||
visible = set()
|
||||
|
||||
# Function pointers for convenience
|
||||
rm_ids = queue.rm_ids
|
||||
reset = queue.reset
|
||||
def rm_ids(ids):
|
||||
global visible
|
||||
visible = visible - set(ids)
|
||||
queue.rm_ids(ids)
|
||||
|
||||
def reset():
|
||||
global visible
|
||||
visible = set()
|
||||
queue.reset()
|
||||
|
||||
def list_ids():
|
||||
for id in queue.queue_list:
|
||||
|
@ -29,5 +35,8 @@ def num_visible():
|
|||
return len(visible)
|
||||
|
||||
def next():
|
||||
return queue.pop()
|
||||
id = queue.pop()
|
||||
if id != None:
|
||||
visible.remove(id)
|
||||
return id
|
||||
|
||||
|
|
Loading…
Reference in New Issue