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:
Bryan Schumaker 2011-05-12 08:11:35 -04:00
parent 8bd914802e
commit 2afabfcf21
2 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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)