Remove from playlist

I can now remove songs from the playlist.
This commit is contained in:
Bryan Schumaker 2010-11-27 10:38:42 -05:00
parent cd91638f9c
commit 333cbaeb37
2 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,10 @@ def add_id(id):
song_list.append(id)
song_set.add(id)
def rm_id(id):
song_list.remove(id)
song_set.remove(id)
def reset():
global song_list
global song_set

View File

@ -18,6 +18,7 @@ def init():
def filler():
plist_page.init(filter, is_visible, right_click, reset)
menu.add_plist_menu_item("Remove from playlist", rm_selected_from_playlist)
plist_page.fill(playlist.walk)
def filter(text):
@ -38,3 +39,8 @@ def refresh(*args):
def right_click(button, time):
menu.make_plist_menu(button, time)
def rm_selected_from_playlist(menu):
plist_page.for_each_selected(playlist.rm_id)
playlist.save()
refresh()