libsaria: remove ids from playlist (improved!)
I moved this to my new file. I grab the lock, remove each id, and then unlock.
This commit is contained in:
parent
8bd914802e
commit
2afabfcf21
|
@ -17,14 +17,7 @@ cur_index = None
|
|||
|
||||
# Function pointers for convenience
|
||||
add_ids = playlist.add_ids
|
||||
|
||||
def rm_id(id):
|
||||
playlist.song_list.remove(id)
|
||||
|
||||
def rm_ids(ids):
|
||||
for id in ids:
|
||||
rm_id(id)
|
||||
save()
|
||||
rm_ids = playlist.rm_ids
|
||||
|
||||
def init():
|
||||
global library
|
||||
|
|
|
@ -15,6 +15,13 @@ def add_ids(id_list):
|
|||
song_list.extend(id_list)
|
||||
unlock_plist()
|
||||
|
||||
def rm_ids(id_list):
|
||||
lock_plist()
|
||||
for id in id_list:
|
||||
if id in song_list:
|
||||
song_list.remove(id)
|
||||
unlock_plist()
|
||||
|
||||
def as_set():
|
||||
lock_plist()
|
||||
song_set = set(song_list)
|
||||
|
|
Loading…
Reference in New Issue
Block a user